Skip to content

Commit

Permalink
tests: enhance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hzhou committed Nov 28, 2023
1 parent 245a43a commit ea2cd04
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/general_comment.def
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ page: test

# Escape with hexcode
\x23! /bin/sh # trailing comments always get filtered
$(shebang_bash)

\x2f* multi-line comments need escape */

Expand All @@ -16,13 +17,17 @@ page: test

$call A

macros:
shebang_bash: #! /bin/bash # trailing comment require #space

template: A
Template # with trailing comment
# Comments can be passed in literally in template
\x2f* Unfortunately multiline comments still need escape */

/* expect test.txt:
#! /bin/sh
#! /bin/bash

/* multi-line comments need escape */

Expand Down
10 changes: 10 additions & 0 deletions tests/general_macros.def
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
page: test
module: general

$(A)
$(B:param)
$(set:c=hello)
$(C)
$call test_basic
$call set_macro
$call export
Expand Down Expand Up @@ -57,8 +61,14 @@ macros:
a: 1, 2, 3
a:: 4, 5
b: param: $1
A: A=$(a)
B: B=$(b:$1) # only simple macros can nest
C: C=$(c) # only static macros can nest

/* expect test.txt:
A=1, 2, 3, 4, 5
B=$(b:param)
C=$(c)
a: [1, 2, 3, 4, 5]
param: b
a: [set]
Expand Down

0 comments on commit ea2cd04

Please sign in to comment.