From 2e94dce94459330ae8e989f307a6cbfd00e5ba32 Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 19 Mar 2010 10:28:24 +0100 Subject: [PATCH] Improved tests of the "arithmetics" grammar. --- test/compiler-test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/compiler-test.js b/test/compiler-test.js index 9d5998f..cdf94c4 100644 --- a/test/compiler-test.js +++ b/test/compiler-test.js @@ -453,12 +453,18 @@ test("arithmetics", function() { parses(parser, "(42+43)", 42+43); /* Test "product" rule. */ + parses(parser, "42", 42); parses(parser, "42*43", 42*43); parses(parser, "42*43*44*45", 42*43*44*45); + parses(parser, "42/43", 42/43); + parses(parser, "42/43/44/45", 42/43/44/45); /* Test "sum" rule. */ + parses(parser, "42*43", 42*43); parses(parser, "42*43+44*45", 42*43+44*45); parses(parser, "42*43+44*45+46*47+48*49", 42*43+44*45+46*47+48*49); + parses(parser, "42*43-44*45", 42*43-44*45); + parses(parser, "42*43-44*45-46*47-48*49", 42*43-44*45-46*47-48*49); /* Test "expr" rule. */ parses(parser, "42+43", 42+43);