summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/dimension/Makefile.am2
-rw-r--r--tests/dimension/numeric.pov2
-rwxr-xr-xtests/dimension/tokenizer.sh11
3 files changed, 13 insertions, 2 deletions
diff --git a/tests/dimension/Makefile.am b/tests/dimension/Makefile.am
index 7bacab5..e9b7f7a 100644
--- a/tests/dimension/Makefile.am
+++ b/tests/dimension/Makefile.am
@@ -25,4 +25,4 @@ TESTS_ENVIRONMENT = top_builddir=$(top_builddir)
tokenizer.sh:
cp $(srcdir)/tokenizer.sh .
-EXTRA_DIST = tokenizer.sh punctuation.pov
+EXTRA_DIST = tokenizer.sh punctuation.pov numeric.pov
diff --git a/tests/dimension/numeric.pov b/tests/dimension/numeric.pov
new file mode 100644
index 0000000..df850d6
--- /dev/null
+++ b/tests/dimension/numeric.pov
@@ -0,0 +1,2 @@
+1 123456789 01234567 0x123456789 -0x01
+.1 0.1 1.0 0.123456789 -0.123456789
diff --git a/tests/dimension/tokenizer.sh b/tests/dimension/tokenizer.sh
index d965741..edd3bb4 100755
--- a/tests/dimension/tokenizer.sh
+++ b/tests/dimension/tokenizer.sh
@@ -24,6 +24,15 @@ punctuation_exp='({ \( [ < + - * / , > ] \) })'
if [ "$punctuation" != "$punctuation_exp" ]; then
echo "punctuation.pov tokenized as \"$punctuation\"" >&2
- echo " -- expected \"$punctuation_exp\"" >&2
+ echo " -- expected \"$punctuation_exp\"" >&2
+ exit 1;
+fi
+
+numeric=$(${top_builddir}/dimension/dimension --tokenize ${srcdir}/numeric.pov)
+numeric_exp='((int "1") (int "123456789") (int "01234567") (int "0x123456789") - (int "0x01") (float ".1") (float "0.1") (float "1.0") (float "0.123456789") - (float "0.123456789"))'
+
+if [ "$numeric" != "$numeric_exp" ]; then
+ echo "numeric.pov tokenized as \"$numeric\"" >&2
+ echo " -- expected \"$numeric_exp\"" >&2
exit 1;
fi