mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-24 13:53:54 +00:00
Estimated hours taken: 0.25 tests/hard_coded/Mmakefile: tests/hard_coded/factt.m: tests/hard_coded/factt_examples: tests/hard_coded/factt.exp: Add a regression test to test three recently-fixed bugs related to fact tables: - duplicate C labels, - incorrect dependencies with --use-subdirs, and - undefined symbols due to passing the wrong arguments to c2init.
34 lines
717 B
Mathematica
34 lines
717 B
Mathematica
:- module factt.
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module int.
|
|
:- pred example(int::in,int::out,int::out) is semidet.
|
|
|
|
:- pragma fact_table(example/3,"factt_examples").
|
|
|
|
:- pred show_examples(int::in,io__state::di, io__state::uo) is det.
|
|
|
|
main -->
|
|
show_examples(1).
|
|
|
|
show_examples(Num) -->
|
|
|
|
({example(Num,Result1,Result2)} ->
|
|
print(Num),print(" "),
|
|
print(Result2),print(" "),
|
|
print(Result1),nl;
|
|
print("Example call failed."),nl
|
|
),
|
|
|
|
{Num1 is Num + 1},
|
|
|
|
({Num1 < 51} ->
|
|
show_examples(Num1);
|
|
print("Finished"),nl
|
|
).
|