summaryrefslogtreecommitdiffstats
path: root/tests/snippets/php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/snippets/php')
-rw-r--r--tests/snippets/php/test_backslashes_in_strings.txt28
-rw-r--r--tests/snippets/php/test_string_escaping_run.txt16
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/snippets/php/test_backslashes_in_strings.txt b/tests/snippets/php/test_backslashes_in_strings.txt
new file mode 100644
index 0000000..4bdbeb5
--- /dev/null
+++ b/tests/snippets/php/test_backslashes_in_strings.txt
@@ -0,0 +1,28 @@
+---input---
+<?php
+$pipe = popen( "flamegraph.pl --title=\"$title\" > /var/www/html/w/docs/flamegraph.svg", 'w' );
+
+---tokens---
+'<?php' Comment.Preproc
+'\n' Text
+
+'$pipe' Name.Variable
+' ' Text
+'=' Operator
+' ' Text
+'popen' Name.Builtin
+'(' Punctuation
+' ' Text
+'"' Literal.String.Double
+'flamegraph.pl --title=' Literal.String.Double
+'\\"' Literal.String.Escape
+'$title' Literal.String.Interpol
+'\\"' Literal.String.Escape
+' > /var/www/html/w/docs/flamegraph.svg' Literal.String.Double
+'"' Literal.String.Double
+',' Punctuation
+' ' Text
+"'w'" Literal.String.Single
+' ' Text
+');' Punctuation
+'\n' Text
diff --git a/tests/snippets/php/test_string_escaping_run.txt b/tests/snippets/php/test_string_escaping_run.txt
new file mode 100644
index 0000000..e31fbfc
--- /dev/null
+++ b/tests/snippets/php/test_string_escaping_run.txt
@@ -0,0 +1,16 @@
+---input---
+<?php $x="{\""; ?>
+
+---tokens---
+'<?php' Comment.Preproc
+' ' Text
+'$x' Name.Variable
+'=' Operator
+'"' Literal.String.Double
+'{' Literal.String.Double
+'\\"' Literal.String.Escape
+'"' Literal.String.Double
+';' Punctuation
+' ' Text
+'?>' Comment.Preproc
+'\n' Other