Files
mercury/tests/hard_coded/tim_qual1.m
Julien Fischer 1f6d83692a Update programming style in tests/hard_coded.
tests/hard_coded/*.m:
    Update programming style, unless doing so would change
    the meaning of the test, in particular:

    - use '.' as a module qualifier in place of '__'
    - use {write,print}_line where appropriate
    - use if-then-else in place of C -> T ; E
    - use state variables in place of DCGs

tests/hard_coded/dir_test.m:
    Document what the expected outputs correspond to.

    Use a uniform module qualifier in the output.

tests/hard_coded/dir_test.exp*:
    Conform to the above change.
2021-01-07 13:58:12 +11:00

38 lines
1008 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
%
% Tests module qualification of types, insts and modes.
% Should get syntax errors if the qualified types, insts and modes are
% not correctly parsed, module qualification errors if the correct match
% cannot be determined or type or determinism errors if the wrong type
% or mode is chosen.
:- module tim_qual1.
:- interface.
:- import_module io.
:- import_module tim_qual2.
:- import_module tim_qual3.
:- pred main(io.state::di, io.state::uo) is det.
:- pred test(tim_qual2.test_type::tim_qual3.test_mode) is det.
:- pred test2(tim_qual2.test_type::test_mode2) is det.
:- mode test_mode2 == tim_qual2.inst1 >> tim_qual3.inst1.
:- implementation.
main(!IO) :-
( if test(ok), test2(ok) then
io.write_string("ok\n", !IO)
else
io.write_string("error\n", !IO)
).
test2(ok).
test(ok).