For review: test case for improved error message

Thomas Charles CONWAY conway at cs.mu.OZ.AU
Tue Sep 22 11:50:12 AEST 1998


Whoever reviews the compiler change I just posted will want to review
this test case too. :-)

-- 
Thomas Conway <conway at cs.mu.oz.au>
Nail here [] for new monitor.  )O+

Add a test case for the changes to the undefined symbol error message.

tests/invalid/Mmakefile:
	Add the new test case.
tests/invalid/undef_symbol.{m,err_exp}:
	The new test case.

cvs diff: Diffing .
Index: Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/tests/invalid/Mmakefile,v
retrieving revision 1.24
diff -u -r1.24 Mmakefile
--- Mmakefile	1998/08/30 04:04:50	1.24
+++ Mmakefile	1998/09/22 01:41:12
@@ -50,6 +50,7 @@
 	unbound_inst_var.m \
 	undef_lambda_mode.m \
 	undef_mode.m \
+	undef_symbol.m \
 	undef_type.m \
 	types.m	\
 	vars_in_wrong_places.m

New files:

tests/invalid/undef_symbol.m:
--------------------------------------------------
:- module undef_symbol.

:- interface.

:- import_module io.

:- pred main(io__state::di, io__state::uo) is det.

:- implementation.

main -->
	p,
	q.

:- pred p(io__state::di, io__state::uo) is det.

p -->
	{ string__append("hello ", "world.\n", Str) },
	io__write_string(Str).

:- pred q(io__state::di, io__state::uo) is det.

q -->
	{ Context = term__context("random", 17) },
	write(Context), nl.

--------------------------------------------------

tests/invalid/undef_symbol.err_exp:
--------------------------------------------------
undef_symbol.m:018: In clause for predicate `undef_symbol:p/2':
undef_symbol.m:018:   error: undefined predicate `string:append/3'
undef_symbol.m:018:   (the module `string' has not been imported).
undef_symbol.m:024: In clause for predicate `undef_symbol:q/2':
undef_symbol.m:024:   error: undefined symbol `term:context/2'
undef_symbol.m:024:   (the module `term' has not been imported).
For more information, try recompiling with `-E'.
--------------------------------------------------




More information about the developers mailing list