Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b27262e7e8
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 33 lines (22 sloc) 0.951 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
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";

# vim: ft=perl6
Something went wrong with that request. Please try again.