diff --git a/exercises/practice/pascals-triangle/pascals_triangle_tests.plt b/exercises/practice/pascals-triangle/pascals_triangle_tests.plt index 731345a3..b1cdde5e 100644 --- a/exercises/practice/pascals-triangle/pascals_triangle_tests.plt +++ b/exercises/practice/pascals-triangle/pascals_triangle_tests.plt @@ -1,5 +1,6 @@ pending :- - current_prolog_flag(argv, ['--all'|_]). + current_prolog_flag(argv, Rows), + Rows == ['--all'|_]. pending :- write('\nA TEST IS PENDING!\n'), fail. @@ -7,37 +8,45 @@ pending :- :- begin_tests(pascal). test(zero_rows, condition(true)) :- - pascal(0, []). + pascal(0, Rows), + Rows == []. test(single_row, condition(pending)) :- - pascal(1, [[1]]). + pascal(1, Rows), + Rows == [[1]]. test(two_rows, condition(pending)) :- - pascal(2, [[1], [1,1]]). + pascal(2, Rows), + Rows == [[1], [1,1]]. test(three_rows, condition(pending)) :- - pascal(3, [[1], [1,1], [1,2,1]]). + pascal(3, Rows), + Rows == [[1], [1,1], [1,2,1]]. test(four_rows, condition(pending)) :- - pascal(4, [[1], [1,1], [1,2,1], [1,3,3,1]]). + pascal(4, Rows), + Rows == [[1], [1,1], [1,2,1], [1,3,3,1]]. test(five_rows, condition(pending)) :- - pascal(5, [[1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]). + pascal(5, Rows), + Rows == [[1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]. test(six_rows, condition(pending)) :- - pascal(6, [[1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1], [1,5,10,10,5,1]]). + pascal(6, Rows), + Rows == [[1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1], [1,5,10,10,5,1]]. test(ten_rows, condition(pending)) :- - pascal(10, [ [1], - [1,1], - [1,2,1], - [1,3,3,1], - [1,4,6,4,1], - [1,5,10,10,5,1], - [1,6,15,20,15,6,1], - [1,7,21,35,35,21,7,1], - [1,8,28,56,70,56,28,8,1], - [1,9,36,84,126,126,84,36,9,1] - ]). + pascal(10, Rows), + Rows == [[1], + [1,1], + [1,2,1], + [1,3,3,1], + [1,4,6,4,1], + [1,5,10,10,5,1], + [1,6,15,20,15,6,1], + [1,7,21,35,35,21,7,1], + [1,8,28,56,70,56,28,8,1], + [1,9,36,84,126,126,84,36,9,1] + ]. :- end_tests(pascal).