new test
authorMichael Wallner <mike@php.net>
Mon, 10 Dec 2018 08:10:32 +0000 (09:10 +0100)
committerMichael Wallner <mike@php.net>
Mon, 10 Dec 2018 08:10:32 +0000 (09:10 +0100)
tests/parser/cpp005.phpt [new file with mode: 0644]
tests/parser/cpp005/expansion.psi [new file with mode: 0644]

diff --git a/tests/parser/cpp005.phpt b/tests/parser/cpp005.phpt
new file mode 100644 (file)
index 0000000..6560247
--- /dev/null
@@ -0,0 +1,34 @@
+--TEST--
+CPP expansion
+--SKIPIF--
+<?php 
+extension_loaded("psi") or die("skip - need ext/psi");
+?>
+--INI--
+psi.directory={PWD}/cpp005
+--FILE--
+===TEST===
+<?php 
+?>
+===DONE===
+--EXPECTF--
+PHP Warning:  PSI syntax error, unexpected NUMBER, expecting ) or "," at col 11 in %stests/parser/cpp005/expansion.psi on line 2
+PHP Warning:  PSI preceding token 'bar' at col 1 in %stests/parser/cpp005/expansion.psi on line 2
+PHP Warning:  PSI preceding token 'foo' at col 1 in %stests/parser/cpp005/expansion.psi on line 2
+PHP Warning:  PSI preceding token '(' at col 10 in %stests/parser/cpp005/expansion.psi on line 2
+PHP Warning:  PSI offending token '2' at col 11 in %stests/parser/cpp005/expansion.psi on line 2
+PHP Warning:  PSI following token ')' at col 12 in %stests/parser/cpp005/expansion.psi on line 2
+
+Warning: PSI syntax error, unexpected NUMBER, expecting ) or "," at col 11 in %stests/parser/cpp005/expansion.psi on line 2
+
+Warning: PSI preceding token 'bar' at col 1 in %stests/parser/cpp005/expansion.psi on line 2
+
+Warning: PSI preceding token 'foo' at col 1 in %stests/parser/cpp005/expansion.psi on line 2
+
+Warning: PSI preceding token '(' at col 10 in %stests/parser/cpp005/expansion.psi on line 2
+
+Warning: PSI offending token '2' at col 11 in %stests/parser/cpp005/expansion.psi on line 2
+
+Warning: PSI following token ')' at col 12 in %stests/parser/cpp005/expansion.psi on line 2
+===TEST===
+===DONE===
diff --git a/tests/parser/cpp005/expansion.psi b/tests/parser/cpp005/expansion.psi
new file mode 100644 (file)
index 0000000..232ab5a
--- /dev/null
@@ -0,0 +1,2 @@
+#define foo(x) bar x
+foo(foo) (2)