Skip to content

Commit 0b4eaf3

Browse files
committed
add tests for edge cases
1 parent d21ca09 commit 0b4eaf3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎ext/readline/tests/readline_cli_multiline_states.phpt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ $proc = proc_open("$php $ini -a", $descriptorspec, $pipes);
1515

1616
fwrite($pipes[0], "\n");
1717
fwrite($pipes[0], "# comment without ini assignment\n");
18-
fwrite($pipes[0], "echo 'single\n';\n");
19-
fwrite($pipes[0], "echo \"double\n\";\n");
18+
fwrite($pipes[0], "echo 'single \\\\ escape\n';\n");
19+
fwrite($pipes[0], "echo \"double \\\\ escape\n\";\n");
2020
fwrite($pipes[0], "echo strtoupper(\n\"paren\"\n);\n");
2121
fwrite($pipes[0], "if (true) {\necho \"block\n\";\n}\n");
22+
fwrite($pipes[0], "// line comment\n");
2223
fwrite($pipes[0], "/*\n*/\necho \"comment\n\";\n");
2324
fwrite($pipes[0], "#[AllowDynamicProperties]\nclass ReadlineCliCoverageClass {}\n");
2425
fwrite($pipes[0], "echo \"attribute\n\";\n");
25-
fwrite($pipes[0], "?>outside-<?php\n");
26-
fwrite($pipes[0], "echo \"inside\n\";\n");
26+
fwrite($pipes[0], "if (true) ?>outside-\n<?php\n{\necho \"inside\n\";\n}\n");
2727
fwrite($pipes[0], "quit\n");
2828
fclose($pipes[0]);
2929
proc_close($proc);

‎ext/readline/tests/readline_cli_prompt.phpt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (!function_exists('proc_open')) die('skip proc_open() not available');
1111
<?php
1212
$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
1313
$ini = getenv('TEST_PHP_EXTRA_ARGS');
14-
$prompt = 'pre\\\\-\n-\t-\e-\v-\b-\>-\`-\q-' . "\xC3\xA9" . '-`echo "dyn";`-x ';
14+
$prompt = 'pre\\\\-\n-\t-\e-\v-\b-\>-\`-\q-' . "\xC3\xA9\xC3\xA9" . '-`echo "dyn";`-x ';
1515
$descriptorspec = [['pipe', 'r'], STDOUT, STDERR];
1616
$proc = proc_open("$php $ini -d " . escapeshellarg("cli.prompt=$prompt") . " -a", $descriptorspec, $pipes);
1717
fwrite($pipes[0], "if (true) {\n");

0 commit comments

Comments
 (0)