mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 10:53:40 +00:00
Estimated hours taken: 1.0 Branches: main extras/quickcheck/qcheck.m: Fix qcheck to work with the current time structure that time__localtime returns. extras/quickcheck/Mmakefile: extras/quickcheck/test_qcheck.m: extras/quickcheck/nrev.m: Add a makefile and a simple testcase for qcheck.
36 lines
1.0 KiB
Mathematica
36 lines
1.0 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% Copyright (C) 2001 The University of Melbourne.
|
|
% This file may only be copied under the terms of the GNU General
|
|
% Public License - see the file COPYING in the Mercury distribution.
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module test_qcheck.
|
|
|
|
:- interface.
|
|
|
|
:- use_module io.
|
|
|
|
:- pred main(io__state, io__state).
|
|
:- mode main(di, uo) is det.
|
|
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- implementation.
|
|
|
|
:- import_module int, list.
|
|
:- import_module qcheck, nrev.
|
|
|
|
%---------------------------------------------------------------------------%
|
|
|
|
main -->
|
|
qcheck(qcheck__f(testing), "sample testing").
|
|
|
|
%------------------------------------------------------------------------------%
|
|
% Invariant test functions
|
|
%------------------------------------------------------------------------------%
|
|
|
|
:- func testing(list(int), list(int)) = property.
|
|
testing(Xs, Ys) =
|
|
nrev(Xs ++ Ys) `===` (nrev(Ys) ++ nrev(Xs)).
|
|
|