[m-rev.] diff: fix test case unused_arg_determinism

Peter Ross petdr at cs.mu.OZ.AU
Wed Feb 13 21:33:57 AEDT 2002


Hi,


===================================================================


Estimated hours taken: 0.5
Branches: main

tests/general/unused_arg_determinism.exp:
tests/general/unused_arg_determinism.m:
    Catch the exception thrown by foo, so that the program can terminate
    normally.


Index: tests/general/unused_arg_determinism.exp
===================================================================
RCS file: /home/staff/zs/imp/tests/general/unused_arg_determinism.exp,v
retrieving revision 1.1
diff -u -r1.1 unused_arg_determinism.exp
--- tests/general/unused_arg_determinism.exp	12 Feb 2002 15:47:58 -0000	1.1
+++ tests/general/unused_arg_determinism.exp	13 Feb 2002 10:28:59 -0000
@@ -1,4 +1 @@
-Uncaught exception:
-Software Error: sorry, `foo' not implemented
-for this target language (or compiler back-end).
-Stack dump not available in this grade.
+Exception.
Index: tests/general/unused_arg_determinism.m
===================================================================
RCS file: /home/staff/zs/imp/tests/general/unused_arg_determinism.m,v
retrieving revision 1.1
diff -u -r1.1 unused_arg_determinism.m
--- tests/general/unused_arg_determinism.m	12 Feb 2002 15:47:58 -0000	1.1
+++ tests/general/unused_arg_determinism.m	13 Feb 2002 10:28:34 -0000
@@ -5,15 +5,26 @@
 :- module unused_arg_determinism.
 :- interface.
 :- import_module io.
-:- pred main(io__state::di, io__state::uo) is det.
+:- pred main(io__state::di, io__state::uo) is cc_multi.
 
 :- type t.
 :- func foo(t) = t.
 :- mode foo(in) = out is semidet.
 
 :- implementation.
+:- import_module exception.
 :- type t ---> t ; u.
+
 main -->
+	try_io(main_2, Result),
+	( { Result = succeeded(_) },
+		io__write_string("No exception.\n")
+	; { Result = exception(_) },
+		io__write_string("Exception.\n")
+	).
+
+:- pred main_2(int::out, io__state::di, io__state::uo) is det.
+main_2(0) -->
 	( { X = foo(t) } ->
 		io__write(X)
 	;

----
Peter Ross
PhD Student University of Melbourne
http://www.cs.mu.oz.au/~petdr/
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list