]> git.draconx.ca Git - cdecl99.git/blobdiff - tests/general.at
tests: Adjust positive tests to verify both parse directions.
[cdecl99.git] / tests / general.at
index 899c7e423734ab2a8e25c70fe901c02b3eece6b8..5141902a0db9a017d939a88416dfd50fe059a5f9 100644 (file)
@@ -97,7 +97,7 @@ AT_SETUP([cdecl99 command error messages])
 # This will only get the start of progname if it includes spaces;
 # so we won't worry too hard about the exact format later.
 AT_CHECK([LC_ALL=C cdecl99 --help], [0], [stdout])
-progname=`$AWK 'NR == 1 { print $2; }' stdout`
+progname=`$AWK 'NR == 1 { print $2; }' stdout`dnl'
 
 # every line is erroneous
 AT_DATA([input],
@@ -117,3 +117,26 @@ AT_CHECK([LC_ALL=C cdecl99 --file=input || exit 42], [42], [], [stderr])
 AT_CHECK([$AWK -v progname="$progname" -f check.awk stderr])
 
 AT_CLEANUP
+
+AT_SETUP([cdecl99 invalid character error messages])
+
+$AWK -f- >test.dat </dev/null <<'EOF'
+BEGIN {
+  print "explain \1";
+  print "explain \377";
+  print "explain \a";
+  print "explain \b";
+  print "explain ?";
+}
+EOF
+
+AT_CHECK([LC_ALL=C cdecl99 -f test.dat || exit 42], [42], [], [stderr])
+AT_CHECK([$AWK '{ print $NF; }' stderr], [0],
+[['\001'
+'\377'
+'\a'
+'\b'
+'?'
+]])
+
+AT_CLEANUP