/
balmaster
/
postgres
Обзор
Документация
Войти
/
balmaster
/
postgres
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/test/modules/test_json_parser/t/003_test_semantic.pl
48 строк
1 KB
Bruce Momjian
Update copyright for 2026
01 янв 2026, 21:24
01 янв 2026, 21:24
451c439
Код
Авторство
О чём код?
# Copyright (c) 2021-2026, PostgreSQL Global Development Group # Test the incremental JSON parser with semantic routines, and compare the # output with the expected output. use strict; use warnings FATAL => 'all'; use PostgreSQL::Test::Utils; use Test::More; use FindBin; use File::Temp qw(tempfile); my $test_file = "$FindBin::RealBin/../tiny.json"; my $test_out = "$FindBin::RealBin/../tiny.out"; my @exes = ( [ "test_json_parser_incremental", ], [ "test_json_parser_incremental", "-o", ], [ "test_json_parser_incremental_shlib", ], [ "test_json_parser_incremental_shlib", "-o", ]); foreach my $exe (@exes) { note "testing executable @$exe"; my ($stdout, $stderr) = run_command([ @$exe, "-s", $test_file ]); is($stderr, "", "no error output"); my $dir = PostgreSQL::Test::Utils::tempdir; my ($fh, $fname) = tempfile(DIR => $dir); print $fh $stdout, "\n"; close($fh); my @diffopts = ("-u"); push(@diffopts, "--strip-trailing-cr") if $windows_os; ($stdout, $stderr) = run_command([ "diff", @diffopts, $fname, $test_out ]); is($stdout, "", "no output diff"); is($stderr, "", "no diff error"); } done_testing();