2 use Test::More qw(no_plan);
5 use Data::Query::ExprDeclare;
6 use Data::Query::Constants;
10 is_deeply(Data::Query::ExprDeclare::_run_expr($sub)->{expr}, @_);
15 type => DQ_IDENTIFIER,
18 'Simple identifier ok';
21 expr_is { $_->foo->bar }
23 type => DQ_IDENTIFIER,
24 elements => [ 'foo', 'bar' ]
26 'Nested identifier ok';
28 expr_is { $_->foo == 3 }
31 operator => { Perl => '==' },
36 subtype => { Perl => 'Scalar' },
43 expr_is { $_->foo == 3 }
46 operator => { Perl => '==' },
51 subtype => { Perl => 'Scalar' },
58 expr_is { 3 == $_->foo }
61 operator => { Perl => '==' },
65 subtype => { Perl => 'Scalar' },
71 'Operand reversed equality ok';
74 expr { $_->foo <=> 3 }
75 } qr/\QCan't use operator <=>/, 'Exception on bad operator';
77 expr_is { $_->foo & $_->bar }
80 operator => { Perl => 'and' },
86 'Masquerade for & as and ok';
88 expr_is { $_->foo | $_->bar }
91 operator => { Perl => 'or' },
97 'Masquerade for | as or ok';
102 operator => { Perl => '!' },
103 args => [ expr { $_->foo } ],