Blame view

bower_components/prism/tests/languages/puppet/heredoc_feature.test 1.17 KB
f748e9cf   Luigi Serra   new controllet an...
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
47
48
49
50
51
  @("FOO")

  	bar

  	$baz

  FOO

  

  @(FOO BAR/)

  	bar

  	$baz

  	| FOO BAR

  

  @(foo!)

  bar

  |-foo!

  

  @("some text..."/nrts$uL)

  some text

  some text..

  some text...

  

  $foo = @(FOOBAR) == $bar

  	Foobar

  	-FOOBAR

  

  ----------------------------------------------------

  

  [

  	["heredoc", ["@(", ["punctuation", "\"FOO\""], ")"]],

  	["heredoc", [

  		"\tbar\r\n\t",

  		["interpolation", ["$baz"]],

  		["punctuation", "FOO"]

  	]],

  	["heredoc", ["@(", ["punctuation", "FOO BAR/"], ")"]],

  	["heredoc", [

  		"\tbar\r\n\t$baz\r\n\t",

  		["punctuation", "| FOO BAR"]

  	]],

  	["heredoc", ["@(", ["punctuation", "foo!"], ")"]],

  	["heredoc", ["bar\r\n", ["punctuation", "|-foo!"]]],

  	["heredoc", ["@(", ["punctuation", "\"some text...\"/nrts$uL"], ")"]],

  	["heredoc", ["some text\r\nsome text..\r\n", ["punctuation", "some text..."]]],

  	["variable", ["$foo"]], ["operator", "="],

  	["heredoc", ["@(", ["punctuation", "FOOBAR"], ")"]],

  	["operator", "=="], ["variable", ["$bar"]],

  	["heredoc", ["\tFoobar\r\n\t", ["punctuation", "-FOOBAR"]]]

  ]

  

  ----------------------------------------------------

  

  Checks for heredoc strings.

  Also checks that string interpolation applies only inside quoted heredoc strings.