mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
test_json_parser: Fix broken file ref and inverted result check
A comma following a file ref in a perl print statement makes the statement just print the file's GLOB rather than redirecting the following arguments to the file. This meant the test was not testing any contents and the logs were instead bulked up with what the test was supposed to be testing. Also, run_log() returns 1 for success, not 0, so the tests for the return values were wrong. (We were getting 0 because of the comma error above.) Backpatch-thru: 17
This commit is contained in:
@@ -26,7 +26,7 @@ my ($fh, $fname) = tempfile(DIR => $dir);
|
||||
|
||||
# repeat the input json file 50 times in an array
|
||||
|
||||
print $fh, '[', $contents, ",$contents" x 49, ']';
|
||||
print $fh '[', $contents, ",$contents" x 49, ']';
|
||||
|
||||
close($fh);
|
||||
|
||||
@@ -34,10 +34,10 @@ close($fh);
|
||||
|
||||
my ($result) = run_log([ $exe, "1", $fname ]);
|
||||
|
||||
ok($result == 0, "perf test runs with recursive descent parser");
|
||||
ok($result, "perf test runs with recursive descent parser");
|
||||
|
||||
$result = run_log([ $exe, "-i", "1", $fname ]);
|
||||
|
||||
ok($result == 0, "perf test runs with table driven parser");
|
||||
ok($result, "perf test runs with table driven parser");
|
||||
|
||||
done_testing();
|
||||
|
||||
Reference in New Issue
Block a user