ast: ?- run_tests(buffer_tokenising:bulk_comments).
% PL-Unit: buffer_tokenising:bulk_comments
ERROR: /home/sean/Documents/code/prolog/the-f-word-project/tokeniser.plt:118:
test bulk_comments: wrong answer (compared using ==)
ERROR: Expected: [com1((0,1,0),";line1"),o_list((7,2,0)),token((8,2,1),"HELLO"),c_list((13,2,6)),comn((14,2,7),"/* haha */"),o_map((24,2,17)),token((25,2,18),"WORLD"),c_map((30,2,23))]
ERROR: Got: [com1((0,1,0),";line1"),o_list((7,2,0)),token((8,2,1),"HELLO"),c_list((13,2,6)),comn((14,2,7),"/* haha */"),o_map((24,2,17)),token((25,2,18),"WORLD"),c_map((30,2,23))]
done
% 1 test failed
% 0 tests passed
I have been scratching my head for hours now, here is the test, the tokeniser is “sound” as lots of the other tests are still passing fine but this one…
test(bulk_comments, [true(Out==Exp)]) :-
Exp = [com1( (0,1,0), ";line1"),
o_list((7,2,0)),
token( (8,2,1), "HELLO"),
c_list((13,2,6)),
comn( (14,2,7), "/* haha */"),
o_map( (24,2,17)),
token( (25,2,18), "WORLD"),
c_map( (30,2,23))
],
tokenise(`;line1\n[HELLO]/* haha */{WORLD}`, Out, []).
I have read and re-read the unit test notes but I just can’t see why it would be saying failed…