2 use Test::More qw(no_plan);
3 use Data::Query::ExprBuilder::Identifier;
4 use Data::Query::Constants qw(DQ_IDENTIFIER DQ_OPERATOR DQ_VALUE);
12 local $_ = Data::Query::ExprBuilder::Identifier->new({
14 type => DQ_IDENTIFIER,
23 is_deeply(_mk_expr($sub), @_);
28 type => DQ_IDENTIFIER,
31 'Simple identifier ok';
34 expr_is { $_->foo->bar }
36 type => DQ_IDENTIFIER,
37 elements => [ 'foo', 'bar' ]
39 'Nested identifier ok';
41 expr_is { $_->foo == 3 }
44 operator => { perl => '==' },
49 subtype => { perl => 'Scalar' },
56 expr_is { $_->foo == 3 }
59 operator => { perl => '==' },
64 subtype => { perl => 'Scalar' },
71 expr_is { 3 == $_->foo }
74 operator => { perl => '==' },
78 subtype => { perl => 'Scalar' },
84 'Operand reversed equality ok';
87 expr { $_->foo <=> 3 }
88 } qr/\QCan't use operator <=>/, 'Exception on bad operator';