From f67f20c8231f145f60ed52b595b78a70cd65693a Mon Sep 17 00:00:00 2001 From: Mathew Bramson Date: Sun, 1 Jul 2018 18:28:19 -0400 Subject: [PATCH] Improve complex_numbers tests Now these tests actually test results properly. --- .../complex-numbers/complex_numbers_tests.plt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/exercises/complex-numbers/complex_numbers_tests.plt b/exercises/complex-numbers/complex_numbers_tests.plt index 151a9387..9765a9e0 100644 --- a/exercises/complex-numbers/complex_numbers_tests.plt +++ b/exercises/complex-numbers/complex_numbers_tests.plt @@ -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).