summaryrefslogtreecommitdiffstats
path: root/tests/snippets/php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 11:33:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 11:33:32 +0000
commit1f403ad2197fc7442409f434ee574f3e6b46fb73 (patch)
tree0299c6dd11d5edfa918a29b6456bc1875f1d288c /tests/snippets/php
parentInitial commit. (diff)
downloadpygments-upstream.tar.xz
pygments-upstream.zip
Adding upstream version 2.14.0+dfsg.upstream/2.14.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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