From: Matt S Trout Date: Sat, 5 Jun 2010 18:06:29 +0000 (+0100) Subject: test reversed operands X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef94e94d25d0363ea928a43a67be44ac2a568713;p=dbsrgits%2FData-Query.git test reversed operands --- diff --git a/t/expr.t b/t/expr.t index e52930d..cfbbb4e 100644 --- a/t/expr.t +++ b/t/expr.t @@ -51,3 +51,33 @@ expr_is { $_->foo == 3 } ], }, 'Simple equality ok'; + +expr_is { $_->foo == 3 } + { + type => DQ_OPERATOR, + operator => { perl => '==' }, + args => [ + expr { $_->foo }, + { + type => DQ_VALUE, + subtype => { perl => 'Scalar' }, + value => 3, + }, + ], + }, + 'Simple equality ok'; + +expr_is { 3 == $_->foo } + { + type => DQ_OPERATOR, + operator => { perl => '==' }, + args => [ + { + type => DQ_VALUE, + subtype => { perl => 'Scalar' }, + value => 3, + }, + expr { $_->foo }, + ], + }, + 'Operand reversed equality ok';