2 use Test::More qw(no_plan);
5 BEGIN { require 't/expr.include' }
9 is_deeply(_run_expr($sub)->{expr}, @_);
14 type => DQ_IDENTIFIER,
17 'Simple identifier ok';
20 expr_is { $_->foo->bar }
22 type => DQ_IDENTIFIER,
23 elements => [ 'foo', 'bar' ]
25 'Nested identifier ok';
27 expr_is { $_->foo == 3 }
30 operator => { Perl => '==' },
35 subtype => { Perl => 'Scalar' },
42 expr_is { $_->foo == 3 }
45 operator => { Perl => '==' },
50 subtype => { Perl => 'Scalar' },
57 expr_is { 3 == $_->foo }
60 operator => { Perl => '==' },
64 subtype => { Perl => 'Scalar' },
70 'Operand reversed equality ok';
73 expr { $_->foo <=> 3 }
74 } qr/\QCan't use operator <=>/, 'Exception on bad operator';
76 expr_is { $_->foo & $_->bar }
79 operator => { Perl => 'and' },
85 'Masquerade for & as and ok';
87 expr_is { $_->foo | $_->bar }
90 operator => { Perl => 'or' },
96 'Masquerade for | as or ok';
101 operator => { Perl => '!' },
102 args => [ expr { $_->foo } ],