[m-dev.] diff: fix test case failure for string_format_test_{2,3}

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Feb 3 23:08:27 AEDT 2000


Estimated hours taken: 0.25

tests/general/Mmakefile:
tests/general/string_format_test_2.exp2:
tests/general/string_format_test_3.exp2:
	Avoid hard-coding dependencies on line numbers
	within the standard library source code in
	the test case output for these two tests.

Index: Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/tests/general/Mmakefile,v
retrieving revision 1.27
diff -u -d -u -r1.27 Mmakefile
--- Mmakefile	1999/10/20 03:14:34	1.27
+++ Mmakefile	2000/02/03 12:07:10
@@ -93,11 +93,25 @@
 
 # string_format_test_2 and string__format_test_3 are expected to fail
 # (string__format should call error/1 for these test cases)
-# so we need to ignore the exit status (hence the leading `-')
+# so we need to ignore the exit status; hence the leading `-'.
+# Also we pipe the output through sed to avoid hard-coding
+# dependencies on particular line numbers in the standard library
+# source code.
 string_format_test_2.out: string_format_test_2
-	-./string_format_test_2 > string_format_test_2.out 2>&1;
+	-./string_format_test_2 2>&1 | \
+		sed -e 's/io.m:[0-9]*/io.m:NNNN/g' \
+		    -e 's/string.m:[0-9]*/string.m:NNNN/g' \
+		    -e 's/require.m:[0-9]*/require.m:NNNN/g' \
+		    -e 's/exception.m:[0-9]*/exception.m:NNNN/g' \
+		> string_format_test_2.out
+		
 string_format_test_3.out: string_format_test_3
-	-./string_format_test_3 > string_format_test_3.out 2>&1;
+	-./string_format_test_3 2>&1 | \
+		sed -e 's/io.m:[0-9]*/io.m:NNNN/g' \
+		    -e 's/string.m:[0-9]*/string.m:NNNN/g' \
+		    -e 's/require.m:[0-9]*/require.m:NNNN/g' \
+		    -e 's/exception.m:[0-9]*/exception.m:NNNN/g' \
+		> string_format_test_3.out
 
 #-----------------------------------------------------------------------------#
 
Index: string_format_test_2.exp2
===================================================================
RCS file: /home/staff/zs/imp/tests/general/string_format_test_2.exp2,v
retrieving revision 1.6
diff -u -d -u -r1.6 string_format_test_2.exp2
--- string_format_test_2.exp2	1999/12/14 02:30:31	1.6
+++ string_format_test_2.exp2	2000/02/03 12:02:49
@@ -1,10 +1,10 @@
 Uncaught exception:
 Software Error: string__format: argument list has more elements than format string
 Stack dump follows:
-   0       pred exception:throw/1-0 (erroneous) (exception.m:278)
-   1       pred require:error/1-0 (erroneous) (require.m:90)
-   2    5* pred string:format_2/3-0 (det) (string.m:846 and others)
-   7       pred string:format/3-0 (det) (string.m:803)
-   8       pred io:format/5-0 (det) (io.m:1761)
-   9       pred io:format/4-0 (det) (io.m:1758)
+   0       pred exception:throw/1-0 (erroneous) (exception.m:NNNN)
+   1       pred require:error/1-0 (erroneous) (require.m:NNNN)
+   2    5* pred string:format_2/3-0 (det) (string.m:NNNN and others)
+   7       pred string:format/3-0 (det) (string.m:NNNN)
+   8       pred io:format/5-0 (det) (io.m:NNNN)
+   9       pred io:format/4-0 (det) (io.m:NNNN)
   10       pred string_format_test_2:main/2-0 (det) (string_format_test_2.m:13)
Index: string_format_test_3.exp2
===================================================================
RCS file: /home/staff/zs/imp/tests/general/string_format_test_3.exp2,v
retrieving revision 1.6
diff -u -d -u -r1.6 string_format_test_3.exp2
--- string_format_test_3.exp2	1999/12/14 02:30:32	1.6
+++ string_format_test_3.exp2	2000/02/03 12:02:42
@@ -1,10 +1,10 @@
 Uncaught exception:
 Software Error: string__format: argument list has fewer elements than format string
 Stack dump follows:
-   0       pred exception:throw/1-0 (erroneous) (exception.m:278)
-   1       pred require:error/1-0 (erroneous) (require.m:90)
-   2       pred string:format_2/3-0 (det) (string.m:846)
-   3       pred string:format/3-0 (det) (string.m:803)
-   4       pred io:format/5-0 (det) (io.m:1761)
-   5       pred io:format/4-0 (det) (io.m:1758)
+   0       pred exception:throw/1-0 (erroneous) (exception.m:NNNN)
+   1       pred require:error/1-0 (erroneous) (require.m:NNNN)
+   2       pred string:format_2/3-0 (det) (string.m:NNNN)
+   3       pred string:format/3-0 (det) (string.m:NNNN)
+   4       pred io:format/5-0 (det) (io.m:NNNN)
+   5       pred io:format/4-0 (det) (io.m:NNNN)
    6       pred string_format_test_3:main/2-0 (det) (string_format_test_3.m:13)
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list