Skip to content

Commit

Permalink
Improve complex_numbers tests
Browse files Browse the repository at this point in the history
Now these tests actually test results properly.
  • Loading branch information
mbramson committed Jul 1, 2018
1 parent 37e36cd commit f67f20c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions exercises/complex-numbers/complex_numbers_tests.plt
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@ pending :-

:- begin_tests(exponent).

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

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

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

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

:- end_tests(exponent).

0 comments on commit f67f20c

Please sign in to comment.