Mercurial > hg > octave-nkf
comparison scripts/help/type.m @ 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 | c792872f8942 |
children | 72c96de7a403 |
comparison
equal
deleted
inserted
replaced
12837:4dfc13ca35b9 | 12838:b584c07cd818 |
---|---|
109 retval {n} = text; | 109 retval {n} = text; |
110 endif | 110 endif |
111 endfor | 111 endfor |
112 endfunction | 112 endfunction |
113 | 113 |
114 %!test | |
115 %! var = 1; | |
116 %! typestr = type ("var"); | |
117 %! typestr = typestr{1}(1:17); | |
118 %! assert (typestr, "var is a variable"); | |
114 | 119 |
120 %!assert (type ('dot'){1}, "dot is a dynamically-linked function") | |
121 %!assert (type ('cat'){1}, "cat is a built-in function") | |
122 %!assert (type ('+'){1}, "+ is an operator") | |
123 %!assert (type ('end'){1}, "end is a keyword") | |
124 %!error (type ('NO_NAME')) |