## move all of these into tests/all.test
# String constant folding (addition only)
-n=`$VALGRIND $Q $JQ -n --debug-dump-disasm '"foo"' | wc -l`
-if [ $n -ne 5 ]; then
- echo "Constant expression folding for strings didn't work"
- exit 1
-fi
+nref=`$VALGRIND $Q $JQ -n --debug-dump-disasm '"foo"' | wc -l`
# Numeric constant folding (not all ops yet)
n=`$VALGRIND $Q $JQ -n --debug-dump-disasm '1+1' | wc -l`
-if [ $n -ne 5 ]; then
+if [ $n -ne $nref ]; then
echo "Constant expression folding for strings didn't work"
exit 1
fi
n=`$VALGRIND $Q $JQ -n --debug-dump-disasm '1-1' | wc -l`
-if [ $n -ne 5 ]; then
+if [ $n -ne $nref ]; then
echo "Constant expression folding for strings didn't work"
exit 1
fi
n=`$VALGRIND $Q $JQ -n --debug-dump-disasm '2*3' | wc -l`
-if [ $n -ne 5 ]; then
+if [ $n -ne $nref ]; then
echo "Constant expression folding for strings didn't work"
exit 1
fi
n=`$VALGRIND $Q $JQ -n --debug-dump-disasm '9/3' | wc -l`
-if [ $n -ne 5 ]; then
+if [ $n -ne $nref ]; then
echo "Constant expression folding for strings didn't work"
exit 1
fi
n=`$VALGRIND $Q $JQ -n --debug-dump-disasm '9==3' | wc -l`
-if [ $n -ne 5 ]; then
+if [ $n -ne $nref ]; then
echo "Constant expression folding for strings didn't work"
exit 1
fi
n=`$VALGRIND $Q $JQ -n --debug-dump-disasm '9!=3' | wc -l`
-if [ $n -ne 5 ]; then
+if [ $n -ne $nref ]; then
echo "Constant expression folding for strings didn't work"
exit 1
fi
n=`$VALGRIND $Q $JQ -n --debug-dump-disasm '9<=3' | wc -l`
-if [ $n -ne 5 ]; then
+if [ $n -ne $nref ]; then
echo "Constant expression folding for strings didn't work"
exit 1
fi
n=`$VALGRIND $Q $JQ -n --debug-dump-disasm '9>=3' | wc -l`
-if [ $n -ne 5 ]; then
+if [ $n -ne $nref ]; then
echo "Constant expression folding for strings didn't work"
exit 1
fi