bc: fix comment handling
[oweals/busybox.git] / testsuite / bc.tests
index 32460092bc3561d52cc25f234c36f79593de81fc..4f0d50f73d0b1befdc9eb8cf76075cbc638a8918 100755 (executable)
@@ -4,6 +4,18 @@
 
 . ./testing.sh
 
+# testing "test name" "command" "expected result" "file input" "stdin"
+
+testing "bc comment 1" \
+       "bc" \
+       "3\n" \
+       "" "1 /* comment */ + 2"
+
+testing "bc comment 2: /*/ is not a closed comment" \
+       "bc" \
+       "4\n" \
+       "" "1 /*/ + 2 */ + 3"
+
 tar xJf bc_large.tar.xz
 
 for f in bc*.bc; do