Skip to content

Commit fc6e9ef

Browse files
committed
Add test cases for previously reported problems (closes:rodjek#103)
Both of these error cases were fixed by the recent merger of the new syntax highlighting file. We'd like however to avoid regressions with regards to those cases.
1 parent 004809c commit fc6e9ef

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/syntax/strings.vader

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Given puppet (heredoc with trailing comma on first line):
2+
class foo {
3+
profile::notes { $title:
4+
notes => @("NOTES"),
5+
A note with an apostrophe in it's midst breaks
6+
highlighting.
7+
|-NOTES
8+
}
9+
10+
Execute (syntax is undisturbed by trailing comma or apostrophe):
11+
AssertEqual SyntaxOf("apostrophe"), 'puppetString'
12+
AssertEqual SyntaxOf("midst"), 'puppetString'
13+
AssertNotEqual SyntaxOf("NOTES",2), 'puppetString'
14+
AssertNotEqual SyntaxOf("}"), 'puppetString'
15+
-------------------------------------------------------------------------------
16+
Given puppet (heredoc with simple closing symbol):
17+
$fix_maxpoll = @(END)
18+
grep ^server $ntp_conf | grep -v 'maxpoll 10'| while read -r line; do
19+
20+
END
21+
22+
exec {
23+
24+
Execute (closing symbol properly ends syntax group):
25+
AssertEqual SyntaxOf("END"), 'puppetStringDelimiter'
26+
AssertEqual SyntaxOf("grep"), 'puppetString'
27+
AssertEqual SyntaxOf("END",2), 'puppetStringDelimiter'
28+
AssertNotEqual SyntaxOf("exec"), 'puppetString'

0 commit comments

Comments
 (0)