File: 02-macros.t

package info (click to toggle)
libtext-trac-perl 0.16-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 364 kB
  • ctags: 257
  • sloc: perl: 2,971; makefile: 2
file content (46 lines) | stat: -rwxr-xr-x 680 bytes parent folder | download | duplicates (3)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use strict;
use t::TestTextTrac;

run_tests;

__DATA__

### macro with no arguments
--- input
[[HelloWorld]]
--- expected
<p>
Hello World, args = 
</p>

### macro with quoted arguments
--- input
[[HelloWorld( "one, one", "two, two", 'three, three' )]]
--- expected
<p>
Hello World, args = one, one, two, two, three, three
</p>

### macro with embedded terminators
--- input
[[HelloWorld( func(arg), ]] )]]
--- expected
<p>
Hello World, args = func(arg), ]]
</p>

### macros with extra ws aren't valid
--- input
[[ HelloWorld(foo) ]]
--- expected
<p>
[[ HelloWorld(foo) ]]
</p>

### unknown macro doesn't die
--- input
[[TheUnknownMacro]]
--- expected
<p>
[[TheUnknownMacro]]
</p>