summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/dimension/directives.pov14
-rwxr-xr-xtests/dimension/directives.sh29
2 files changed, 37 insertions, 6 deletions
diff --git a/tests/dimension/directives.pov b/tests/dimension/directives.pov
index 6907450..6b0e72c 100644
--- a/tests/dimension/directives.pov
+++ b/tests/dimension/directives.pov
@@ -19,6 +19,16 @@
// Test the language directives
-#include "punctuation.pov"
+#declare Center = 0;
+#declare R = 1;
+#local Color = rgb <1, 0, 1>;
-#declare id
+#declare Unused = -1;
+#undef Unused
+
+sphere {
+ Center, R
+ pigment {
+ color Color
+ }
+}
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