trivial diff: improve a test case

Fergus Henderson fjh at cs.mu.OZ.AU
Mon May 18 18:54:15 AEST 1998


Estimated hours taken: 0.1

tests/invalid/typeclass_test_2.m:
tests/invalid/typeclass_test_2.err_exp:
	Use more newlines in the test case source so that the test
	that the error message is on the correct line number is more
	stringent.

Index: typeclass_test_2.m
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/typeclass_test_2.m,v
retrieving revision 1.1
diff -u -r1.1 typeclass_test_2.m
--- typeclass_test_2.m	1998/01/29 08:39:53	1.1
+++ typeclass_test_2.m	1998/05/18 08:49:34
@@ -5,14 +5,19 @@
 
 :- implementation.
 
-main --> io__write_int(type_num(42)).
+main -->
+	io__write_int(
+		type_num(42)		% type error here
+					% (due to the syntax error below)
+	),
+	nl.
 
 :- typeclass numbered_type(T) where [
 	func type_num(T) = int
 ].
 
 :- instance numbered_type(int) where [
-	type_num/0 is foo_type_num
+	type_num/0 is foo_type_num	% syntax error here
 ].
 
 foo_type_num(_) = 42.
Index: typeclass_test_2.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/typeclass_test_2.err_exp,v
retrieving revision 1.4
diff -u -r1.4 typeclass_test_2.err_exp
--- typeclass_test_2.err_exp	1998/04/09 18:33:13	1.4
+++ typeclass_test_2.err_exp	1998/05/18 08:49:57
@@ -1,9 +1,9 @@
 typeclass_test_2.m:001: Warning: incorrect module name in `:- module' declaration: :- module foo.
-typeclass_test_2.m:015: Error: expected `pred(<Name> / <Arity>) is <InstanceName>': type_num / 0 is foo_type_num.
-typeclass_test_2.m:018: Error: clause for function `typeclass_test_2:foo_type_num/1'
-typeclass_test_2.m:018:   without preceding `func' declaration.
-typeclass_test_2.m:008: In clause for predicate `typeclass_test_2:main/2':
-typeclass_test_2.m:008:   unsatisfied typeclass constraint(s):
-typeclass_test_2.m:008:   typeclass_test_2:numbered_type(int).
-typeclass_test_2.m:018: Inferred :- func foo_type_num(T1) = int.
+typeclass_test_2.m:020: Error: expected `pred(<Name> / <Arity>) is <InstanceName>': type_num / 0 is foo_type_num.
+typeclass_test_2.m:023: Error: clause for function `typeclass_test_2:foo_type_num/1'
+typeclass_test_2.m:023:   without preceding `func' declaration.
+typeclass_test_2.m:010: In clause for predicate `typeclass_test_2:main/2':
+typeclass_test_2.m:010:   unsatisfied typeclass constraint(s):
+typeclass_test_2.m:010:   typeclass_test_2:numbered_type(int).
+typeclass_test_2.m:023: Inferred :- func foo_type_num(T1) = int.
 For more information, try recompiling with `-E'.

-- 
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.



More information about the developers mailing list