[m-rev.] diff: another test case
Mark Brown
dougl at cs.mu.OZ.AU
Thu Oct 10 20:46:55 AEST 2002
This is another test case similar to the previous two I posted. I'm
currently working on solutions to all of these.
Cheers,
Mark.
Estimated hours taken: 0.5
Branches: main
tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/ho5.exp:
tests/debugger/declarative/ho5.inp:
tests/debugger/declarative/ho5.m:
A new test case which we don't yet pass, and which is currently
disabled.
Index: tests/debugger/declarative/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/Mmakefile,v
retrieving revision 1.46
diff -u -r1.46 Mmakefile
--- tests/debugger/declarative/Mmakefile 10 Oct 2002 05:59:02 -0000 1.46
+++ tests/debugger/declarative/Mmakefile 10 Oct 2002 10:38:52 -0000
@@ -49,9 +49,14 @@
# order terms. This happens because for missing answer questions the oracle
# stores the solutions in a set, which relies on builtin comparison.
#
+# XXX 'ho5' also fails due to an attempt to compare higher order terms. This
+# happens because thrown exceptions are stored in a set, and exceptions are
+# not necessarily first order terms.
+#
NONWORKING_DECLARATIVE_PROGS= \
ho3 \
- ho4
+ ho4 \
+ ho5
# Some of the test cases require a different input in debug grades,
# so we set INP to the appropriate extension to use for those tests.
@@ -169,6 +174,9 @@
ho4.out: ho4 ho4.inp
$(MDB) ./ho4 < ho4.inp > ho4.out 2>&1
+
+ho5.out: ho5 ho5.inp
+ $(MDB) ./ho5 < ho5.inp > ho5.out 2>&1
if_then_else.out: if_then_else if_then_else.inp
$(MDB) ./if_then_else < if_then_else.inp > if_then_else.out 2>&1
Index: tests/debugger/declarative/ho5.exp
===================================================================
RCS file: tests/debugger/declarative/ho5.exp
diff -N tests/debugger/declarative/ho5.exp
Index: tests/debugger/declarative/ho5.inp
===================================================================
RCS file: tests/debugger/declarative/ho5.inp
diff -N tests/debugger/declarative/ho5.inp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/ho5.inp 10 Oct 2002 10:34:55 -0000
@@ -0,0 +1,14 @@
+echo on
+register --quiet
+break p
+continue
+finish
+dd
+no
+yes
+yes
+yes
+continue
+finish
+dd
+no
Index: tests/debugger/declarative/ho5.m
===================================================================
RCS file: tests/debugger/declarative/ho5.m
diff -N tests/debugger/declarative/ho5.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/ho5.m 10 Oct 2002 10:32:45 -0000
@@ -0,0 +1,38 @@
+:- module ho5.
+:- interface.
+:- import_module io.
+:- pred main(io__state::di, io__state::uo) is cc_multi.
+:- implementation.
+:- import_module exception.
+
+main -->
+ { try(p(1), R1) },
+ io__write(R1),
+ io__nl,
+ { try(p(2), R2) },
+ io__write(R2),
+ io__nl.
+
+:- pred p(int::in, int::out) is det.
+
+p --> q, r.
+
+:- pred q(int::in, int::out) is det.
+
+q(_, 0).
+
+:- pred r(int::in, int::out) is det.
+
+r(M, N) :-
+ (
+ M = 0
+ ->
+ throw(zero)
+ ;
+ N = 0
+ ).
+
+:- func zero(int) = string.
+
+zero(_) = "zero".
+
--------------------------------------------------------------------------
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