aboutsummaryrefslogtreecommitdiff
path: root/src/test/modules/test_json_parser/t/003_test_semantic.pl
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2024-04-23 15:27:40 -0400
committerAndrew Dunstan <andrew@dunslane.net>2024-04-23 15:32:06 -0400
commitba3e6e2bca97df14920375b0a1ebf4eab95b78b5 (patch)
treeee3e960a3d3ae2ff28dc719f5aa86aeea8b2173b /src/test/modules/test_json_parser/t/003_test_semantic.pl
parentb7d35d393edbe2d4333dde81496e8a362abc85bd (diff)
downloadpostgresql-ba3e6e2bca97df14920375b0a1ebf4eab95b78b5.tar.gz
postgresql-ba3e6e2bca97df14920375b0a1ebf4eab95b78b5.zip
Post review fixes for test_json_parser test module
. Add missing copytight notices . improve code coverage . put work files in a temp directory in the standard location . improve error checking in C code . indent perl files with perltidy . add some comments per comments from Michael Paquier Discussion: https://postgr.es/m/ZiC3-cdFys4-6xSk@paquier.xyz
Diffstat (limited to 'src/test/modules/test_json_parser/t/003_test_semantic.pl')
-rw-r--r--src/test/modules/test_json_parser/t/003_test_semantic.pl15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/test/modules/test_json_parser/t/003_test_semantic.pl b/src/test/modules/test_json_parser/t/003_test_semantic.pl
index 7b4941b7f9f..7d3e07e750c 100644
--- a/src/test/modules/test_json_parser/t/003_test_semantic.pl
+++ b/src/test/modules/test_json_parser/t/003_test_semantic.pl
@@ -1,3 +1,9 @@
+
+# Copyright (c) 2021-2024, PostgreSQL Global Development Group
+
+# Test the incremental JSON parser with semantic routines, and compare the
+# output with the expected output.
+
use strict;
use warnings;
@@ -12,17 +18,18 @@ my $test_out = "$FindBin::RealBin/../tiny.out";
my $exe = "test_json_parser_incremental";
-my ($stdout, $stderr) = run_command( [$exe, "-s", $test_file] );
+my ($stdout, $stderr) = run_command([ $exe, "-s", $test_file ]);
is($stderr, "", "no error output");
-my ($fh, $fname) = tempfile();
+my $dir = PostgreSQL::Test::Utils::tempdir;
+my ($fh, $fname) = tempfile(DIR => $dir);
-print $fh $stdout,"\n";
+print $fh $stdout, "\n";
close($fh);
-($stdout, $stderr) = run_command(["diff", "-u", $fname, $test_out]);
+($stdout, $stderr) = run_command([ "diff", "-u", $fname, $test_out ]);
is($stdout, "", "no output diff");
is($stderr, "", "no diff error");