changeset 12838:b584c07cd818

codesprint: Add tests for type() * type.m: Add tests for all casses except a .m file
author Rik <octave@nomad.inbox5.com>
date Sat, 16 Jul 2011 14:56:40 -0700
parents 4dfc13ca35b9
children a2c81af1992d ecafefd638c9
files scripts/help/type.m
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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'))