Skip to content

Commit beb898d

Browse files
committed
Improve complex_numbers tests
Now these tests actually test results properly.
1 parent 37e36cd commit beb898d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

exercises/complex-numbers/complex_numbers_tests.plt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ pending :-
125125
:- begin_tests(exponent).
126126

127127
test(eulers_identity, condition(pending)) :-
128-
exponent((0,pi), (X,Y)), X \= -1, Y \= 0.
128+
exponent((0,pi), (X,Y)), X > -1.001, X < -0.999, Y > -0.001, Y< 0.001.
129129

130130
test(exponential_of_zero, condition(pending)) :-
131-
exponent((0,0), (X,Y)), X \= 1, Y \= 0.
131+
exponent((0,0), (X,Y)), X > 0.999, X < 1.001, Y > -0.001, Y < 0.001.
132132

133133
test(exponential_of_purely_real_number, condition(pending)) :-
134-
exponent((1,0), (X,Y)), X \= e, Y \= 0.
134+
exponent((1,0), (X,Y)), X > e - 0.001, X < e + 0.001, Y > -0.001, Y < 0.001.
135135

136136
test(exponential_of_number_with_real_and_imaginary_part, condition(pending)) :-
137-
exponent((log(2),pi), (X,Y)), X \= -2, Y \= 0.
137+
exponent((log(2),pi), (X,Y)), X > -2.001, X < -1.999, Y > -0.001, Y < 0.001.
138138

139139
:- end_tests(exponent).

0 commit comments

Comments
 (0)