summaryrefslogtreecommitdiffstats
path: root/tests/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-10-27 00:32:13 -0400
committerTavian Barnes <tavianator@gmail.com>2009-10-27 00:48:47 -0400
commit5ec5ae21da84cc96676b6cae39a5ded820a5492a (patch)
tree4b057822c1b824509d8b0a6c1ba91ba7b611a9c7 /tests/dimension
parent30754dcca0f8a4d553e9c865f7cd27f85d2919ee (diff)
downloaddimension-5ec5ae21da84cc96676b6cae39a5ded820a5492a.tar.xz
New tokenizer test.
Diffstat (limited to 'tests/dimension')
-rw-r--r--tests/dimension/Makefile.am25
-rw-r--r--tests/dimension/braces.pov8
-rwxr-xr-xtests/dimension/tokenizer.sh10
3 files changed, 43 insertions, 0 deletions
diff --git a/tests/dimension/Makefile.am b/tests/dimension/Makefile.am
new file mode 100644
index 0000000..89c228e
--- /dev/null
+++ b/tests/dimension/Makefile.am
@@ -0,0 +1,25 @@
+###########################################################################
+## Copyright (C) 2009 Tavian Barnes <tavianator@gmail.com> ##
+## ##
+## This file is part of The Dimension Build Suite. ##
+## ##
+## The Dimension Build Suite is free software; you can redistribute it ##
+## and/or modify it under the terms of the GNU General Public License as ##
+## published by the Free Software Foundation; either version 3 of the ##
+## License, or (at your option) any later version. ##
+## ##
+## The Dimension Build Suite is distributed in the hope that it will be ##
+## useful, but WITHOUT ANY WARRANTY; without even the implied warranty ##
+## of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ##
+## General Public License for more details. ##
+## ##
+## You should have received a copy of the GNU General Public License ##
+## along with this program. If not, see <http://www.gnu.org/licenses/>. ##
+###########################################################################
+
+INCLUDES = -I$(top_srcdir)/libdimension
+
+TESTS = tokenizer.sh
+TESTS_ENVIRONMENT = TOP_BUILDDIR=$(top_builddir)
+
+EXTRA_DIST = braces.pov
diff --git a/tests/dimension/braces.pov b/tests/dimension/braces.pov
new file mode 100644
index 0000000..295a69a
--- /dev/null
+++ b/tests/dimension/braces.pov
@@ -0,0 +1,8 @@
+{
+ {
+ }
+}
+}
+ }
+ {
+{
diff --git a/tests/dimension/tokenizer.sh b/tests/dimension/tokenizer.sh
new file mode 100755
index 0000000..35bcf65
--- /dev/null
+++ b/tests/dimension/tokenizer.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+braces=$(${TOP_BUILDDIR}/dimension/dimension --tokenize braces.pov)
+braces_exp='({ { } } } } { {)'
+
+if [ "$braces" != "$braces_exp" ]; then
+ echo "braces.pov tokenized as \"$braces\"" >&2
+ echo " -- expected \"$braces_exp\"" >&2
+ exit 1;
+fi