Skip to content

Commit

Permalink
New tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fadado committed Apr 1, 2017
1 parent a1e080f commit 12c904b
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/assets/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# _jqt_ · The _jq_ template engine

This is the documentation for _jqt_.
Visit the web site at <https://fadado.github.io/jqt>.
Visit the generated web site at <https://fadado.github.io/jqt>.

<!--
vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=markdown
Expand Down
2 changes: 1 addition & 1 deletion docs/content/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ just before the newline character
_Strings_ are copied to the output, but evaluation of macros inside strings can
be enabled or disabled. String delimiters can be copied, or not, to the output:

~~~HTML
~~~
<!-- XML comments -->
<%sc 'Single quoted strings, only available in user defined macro calls'>
<%sc "Double quoted strings, only available in user defined macro calls">
Expand Down
23 changes: 23 additions & 0 deletions tests/expand/expected/mpcss-07.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
10...

9...

8...

7...

6...

5...

4...

3...

2...

1...


Done!

28 changes: 28 additions & 0 deletions tests/expand/expected/mpcss-08.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ACA
AACAA
AACAA
AXDXA
BAXDXAB
APA
PYYP
PYYP
Q&A}{C}R
A&A}{X}A
BAX&A}{X}XAB
Q&R}
Q[&A}{C}]R
/* Output:
ACA
AACAA
AACAA
AXDXA
BAXDXAB
APA
PYYP
PYYP
QAA C}R
AAA X}A
BAXAA X}XAB
Q&R}
Q[AA C}]R
*/
7 changes: 7 additions & 0 deletions tests/expand/expected/mpjson-12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"firstName": "Mister John F.",
"lastName": "Kennedy",
"age": 25,
"gender": { "type": "male" }
}

12 changes: 12 additions & 0 deletions tests/expand/mpcss-07.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// recursion
&define{countdown}{
&if{$1}&
$1...
&define{_countdown}{&countdown{$1}}&
&else
Done!
&define{_countdown}{}&
&endif
&_countdown{&eval{$1-1}}&
}&
&countdown{10}&
36 changes: 36 additions & 0 deletions tests/expand/mpcss-08.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// examples from GPM paper
&define{A}{A$1A}&
&define{B}{B&A{X$1X}B}&
&define{APA}{P$1$1P}&
&
&A{C}
&A{ACA}
&A{&A{C}}
&A{XDX}
&B{D}
&A{P}
&APA{Y}
&call{&A{P}}{Y}
&
&mode{comment}{qqq "[" "]"}&
Q[&A}{C}]R
&A{[&A}{X}]}
&B{[&A}{X}]}
Q[&]R[}]
Q[[&A}{C}]]R
&
/* Output:
ACA
AACAA
AACAA
AXDXA
BAXDXAB
APA
PYYP
PYYP
Q&A C}R
A&A X}A
BAX&A X}XAB
Q&R}
Q[&A C}]R
*/&
9 changes: 9 additions & 0 deletions tests/expand/mpjson-12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Macros
&define{T}{Mister }&
{
"firstName": "&T&_{}John F.",
"lastName": "Kennedy",
"age": 25,
"gender": { "type": "male" }
}
// vim:sw=4:ts=4:ai:et:syntax=javascript

0 comments on commit 12c904b

Please sign in to comment.