Skip to content

Commit bd69abe

Browse files
committed
added tests for intersection/3, refs #7
1 parent a11fa55 commit bd69abe

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests.lgt

+15-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
wid(X, Wid),
122122
Wid == 1.
123123

124-
% abs/2 tests
124+
% mag/2 tests
125125
test(interval_arithmetic_mag_2_01, deterministic) :-
126126
new(-3, 2, X),
127127
mag(X, Mag),
@@ -131,5 +131,19 @@
131131
new(-3, 2, X),
132132
mag(X, Mag),
133133
Mag == 2.
134+
135+
% mig/2 tests
136+
137+
% intersection/3 tests
138+
test(interval_arithmetic_intersection_03_01, deterministic) :-
139+
new(1, 2, X),
140+
new(0, 4, Y),
141+
intersection(X, Y, Inter),
142+
Inter == (1, 2).
143+
144+
test(interval_arithmetic_intersection_03_02, fail) :-
145+
new(1, 2, X),
146+
new(3, 4, Y),
147+
intersection(X, Y, _).
134148

135149
:- end_object.

0 commit comments

Comments
 (0)