Permalink
Browse files

[t] move some parsing tests to spec/

git-svn-id: http://svn.pugscode.org/pugs@24276 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 2dfae48 commit 61bff0ef4768eaa18a9731df7393f45bccd45337 moritz committed Dec 11, 2008
Showing with 30 additions and 0 deletions.
  1. +30 −0 S02-one-pass-parsing/less-than.t
@@ -0,0 +1,30 @@
+use v6;
+
+use Test;
+
+plan 9;
+
+# L<S02/One-pass parsing/>
+
+# test parsing of < and >, especially distinction between operators
+# and terms (when used as a quote as in <a b c>)
+#
+# nearly all of these tests had been regressions at one point,
+# so don't discard them for being too simple ;-)
+
+ok(rand >= 0, 'random numbers are greater than or equal to 0');
+ok(rand < 1, 'random numbers are less than 1');
+
+ok 3 > 0, "3 is greater than 0";
+
+
+# used to be a pugs regression
+# ~< foo bar >
+# doesn't parse (as does +< foo bar >).
+is eval('~< foo bar >'), "foo bar", "~<...> is parsed correctly";
+is eval('+< foo bar >'), 2, "+<...> is parsed correctly";
+ok eval('?< foo bar >'), "?<...> is parsed correctly";
+
+is eval('~(< foo bar >)'), "foo bar", "~(<...>) is parsed correctly";
+is eval('+(< foo bar >)'), 2, "+(<...>) is parsed correctly";
+ok eval('?(< foo bar >)'), "?(<...>) is parsed correctly";

0 comments on commit 61bff0e

Please sign in to comment.