mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 04:13:46 +00:00
Estimated hours taken: 0.2
tests/hardcoded/qual_basic_test.m
tests/hardcoded/qual_adv_test.m
tests/hardcoded/qual_strang.m
tests/hardcoded/qual_strung.m
Test module qualified function calls and higher-order pred constants.
30 lines
576 B
Mathematica
30 lines
576 B
Mathematica
:- module qual_basic_test.
|
|
|
|
% A test to ensure qualified predicates, function calls
|
|
% and higher-order constants are parsed correctly.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred qual_basic_test:main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module int.
|
|
|
|
qual_basic_test:main -->
|
|
io:io__write_string("Gotcha1!\n"),
|
|
{ A is qual_basic_test:test },
|
|
{ X is int:(A + 2) },
|
|
io:io__write_int(X),
|
|
io__write_string("\n"),
|
|
{ Pred = int:int__max },
|
|
{ call(Pred, 1, 2, Y) },
|
|
io__write_int(Y),
|
|
io__write_string("\n").
|
|
|
|
:- func test = int.
|
|
|
|
test = 2.
|