Skip to content

Commit

Permalink
Fix arguments in editline tests that only run in cmake builds
Browse files Browse the repository at this point in the history
Summary:
We failed to update these unit tests when we banned argument coercion for builtin arguments (because we never run these tests internally). Try to fix these tests by replacing values of the wrong type with the values that they would have been coerced to when that was still allowed.

Also fix one test expectation that was not adjusted to deal with hack array migration.

Differential Revision: D39861971

fbshipit-source-id: 7052b9ebe84d41fca4eb9eea099d991e564d1a08
  • Loading branch information
alexeyt authored and facebook-github-bot committed Sep 28, 2022
1 parent 09c1604 commit 206c8d4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions hphp/test/slow/ext_readline/libedit_write_history.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

readline_add_history('foo');
readline_add_history('');
readline_add_history(1);
readline_add_history(NULL);
readline_add_history('1');
readline_add_history('');
var_dump(readline_write_history($name));
var_dump(readline_read_history($name));

Expand Down
8 changes: 4 additions & 4 deletions hphp/test/zend/good/ext/readline/tests/libedit_info_001.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?hh
<<__EntryPoint>> function main(): void {
var_dump(@readline_info());
var_dump(@readline_info(1));
var_dump(@readline_info(1,1));
var_dump(@readline_info('1'));
var_dump(@readline_info('1','1'));
var_dump(@readline_info('line_buffer'));
var_dump(@readline_info('readline_name'));
var_dump(@readline_info('readline_name', 1));
var_dump(@readline_info('readline_name', '1'));
var_dump(@readline_info('readline_name'));
var_dump(@readline_info('attempted_completion_over',1));
var_dump(@readline_info('attempted_completion_over', '1'));
var_dump(@readline_info('attempted_completion_over'));
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
array(6) {
dict(6) {
["line_buffer"]=>
string(0) ""
["point"]=>
Expand All @@ -19,4 +19,4 @@ string(0) ""
string(0) ""
string(1) "1"
int(0)
int(1)
int(1)
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

readline_add_history('foo');
readline_add_history('');
readline_add_history(1);
readline_add_history(NULL);
readline_add_history('1');
readline_add_history('');
readline_write_history($name);

var_dump(file_get_contents($name));
Expand Down

0 comments on commit 206c8d4

Please sign in to comment.