# HG changeset patch # User Rik # Date 1310853400 25200 # Node ID b584c07cd81827e7df148c51c08af34966da777e # Parent 4dfc13ca35b94a0764dcca7737980a80af680d16 codesprint: Add tests for type() * type.m: Add tests for all casses except a .m file diff --git a/scripts/help/type.m b/scripts/help/type.m --- a/scripts/help/type.m +++ b/scripts/help/type.m @@ -111,4 +111,14 @@ endfor endfunction +%!test +%! var = 1; +%! typestr = type ("var"); +%! typestr = typestr{1}(1:17); +%! assert (typestr, "var is a variable"); +%!assert (type ('dot'){1}, "dot is a dynamically-linked function") +%!assert (type ('cat'){1}, "cat is a built-in function") +%!assert (type ('+'){1}, "+ is an operator") +%!assert (type ('end'){1}, "end is a keyword") +%!error (type ('NO_NAME'))