]> git.mdlowis.com Git - archive/dlang-scm.git/commitdiff
Added test for infix operator application
authorMike D. Lowis <mike@mdlowis.com>
Wed, 18 Jul 2012 20:29:09 +0000 (16:29 -0400)
committerMike D. Lowis <mike@mdlowis.com>
Wed, 18 Jul 2012 20:29:09 +0000 (16:29 -0400)
tests/test_parser.scm

index 65ccb44a305361231b85844a2b2d30841fabb5e0..e85a8e39f73d3353b485bef03dc5294ec2ee68b3 100644 (file)
 
 ; dlang/operator-app
 ;------------------------------------------------------------------------------
+(def-test "dlang/operator-app should parse an infix operator application"
+  (call-with-input-string "(1.0 * 2.0)"
+    (lambda (input)
+      (define lxr (make-lexer input))
+      (define result (dlang/operator-app lxr))
+      (syntree=? result
+        (syntree 'apply ""
+          (list
+            (syntree 'id "*" '())
+            (syntree 'number "1.0" '())
+            (syntree 'number "2.0" '())))))))
 
 ; dlang/operator
 ;------------------------------------------------------------------------------