summaryrefslogtreecommitdiffstats
path: root/tests/dimension/directives.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-12-21 00:36:12 -0500
committerTavian Barnes <tavianator@gmail.com>2009-12-21 02:32:06 -0500
commit494079ee46d67ae7ef6504734f7400b543c6d848 (patch)
tree9f4ad236fe10ef99b422913edc98d85cf83f99aa /tests/dimension/directives.sh
parent0eb3d602df451f882e107ebed47b3bce9a1e68dc (diff)
downloaddimension-494079ee46d67ae7ef6504734f7400b543c6d848.tar.xz
Support #declare, #local, and #undef.
Diffstat (limited to 'tests/dimension/directives.sh')
-rwxr-xr-xtests/dimension/directives.sh29
1 files changed, 25 insertions, 4 deletions
diff --git a/tests/dimension/directives.sh b/tests/dimension/directives.sh
index 75c2452..c64cbd8 100755
--- a/tests/dimension/directives.sh
+++ b/tests/dimension/directives.sh
@@ -19,11 +19,32 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
#########################################################################
-directives=$(${top_builddir}/dimension/dimension --tokenize ${srcdir}/directives.pov)
-directives_exp='(#include (string "punctuation.pov") #declare (identifier "id"))';
+directives=$(${top_builddir}/dimension/dimension --tokenize --parse ${srcdir}/directives.pov)
+directives_exp="$(echo -n \
+'(#declare (identifier "Center") = (integer "0") ;
+ #declare (identifier "R") = (integer "1") ;
+ #local (identifier "Color") = rgb < (integer "1") , (integer "0") , (integer "1") > ;
+ #declare (identifier "Unused") = - (integer "1") ;
+ #undef (identifier "Unused")
+ sphere {
+ (identifier "Center") , (identifier "R")
+ pigment {
+ color (identifier "Color")
+ }
+ })' \
+| tr '\n' ' ' | sed -r 's/[[:space:]]+/ /g')
+$(echo -n \
+'((sphere
+ (vector (integer 0) (integer 0) (integer 0) (integer 0) (integer 0))
+ (integer 1)
+ (object-modifiers
+ (texture
+ (pigment (vector (integer 1) (integer 0) (integer 1)
+ (integer 0) (integer 0)))))))' \
+| tr '\n' ' ' | sed -r 's/[[:space:]]+/ /g')"
if [ "$directives" != "$directives_exp" ]; then
- echo "directives.pov tokenized as \"$directives\"" >&2
- echo " -- expected \"$directives_exp\"" >&2
+ echo "directives.pov parsed as \"$directives\"" >&2
+ echo " -- expected \"$directives_exp\"" >&2
exit 1
fi