-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests.lgt
29 lines (19 loc) · 1.14 KB
/
tests.lgt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
:- use_module(teruel).
:- object(tests, extends(lgtunit)).
test(trivial, true) :-
true.
test(simple_substitution, true(Assertion)) :-
template_test("templates/a.in.html", "templates/a.out.html", ["username"-"aarroyoc"], Assertion).
test(raw_block, true(Assertion)) :-
template_test("templates/b.in.html", "templates/b.out.html", ["username"-"aarroyoc"], Assertion).
test(comment_block, true(Assertion)) :-
template_test("templates/c.in.html", "templates/c.out.html", ["username"-"aarroyoc"], Assertion).
test(for_loop, true(Assertion)) :-
template_test("templates/h.in.html", "templates/h.out.html", ["username"-"aarroyoc", "links"-["https://github.com", "https://adrianistan.eu"]], Assertion).
test(for_loop_filter, true(Assertion)) :-
template_test("templates/j.in.html", "templates/j.out.html", ["webs"-[["name"-"Google", "popularity"-100], ["name"-"GitHub", "popularity"-40]]], Assertion).
% auxiliary predicates
template_test(In, Out, Vars, Assertion) :-
teruel:render(In, Vars, OutputReal),
^^text_file_assertion(Out, OutputReal, Assertion).
:- end_object.