/
TLDR_between_with_step.txt
52 lines (31 loc) · 1.3 KB
/
TLDR_between_with_step.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
To use between_with_step.pl:
1)
Set up a directory hierarchy with the Prolog module and the Prolog plunit code in your directory $FOO like this, wherever $FOO is:
$FOO
└── modules/
└── heavycarbon/
└── utils/
├── between_with_step.pl <-- the source for between/4 and between/5 in module "between_with_step"
└── between_with_step.plt <-- the source for the plunit test "between_with_step" (which will be put into module "plunit_between_with_step")
2)
Start SWI Prolog
Add the topmost directory to the library search path (replace $FOO as usual with an actual path):
?- assertz(file_search_path(library,'$FOO/heavycarbon')).
3)
Load the module, which (confusingly) is given by file name, not module name:
?- use_module(library('heavycarbon/utils/between_with_step.pl')).
4)
Load the associated .plt files automagically:
?- load_test_files([]).
true.
5)
Run tests
?- run_tests.
% PL-Unit: between_with_step ................................................................................ done
% All 80 tests passed
true.
6)
Use between/4 and between/5 as usual.
(Sadly, help(between/4). and help(between/5). do not work yet).
X)
For totally more on this: https://github.com/dtonhofer/prolog_notes/blob/master/code/load_and_test_script.pl