summaryrefslogtreecommitdiffstats
path: root/src/bin/pg_test_fsync/t/001_basic.pl
blob: 8c5c0e7967b4a1034f37d5a474c04c6bb481534c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright (c) 2021-2022, PostgreSQL Global Development Group

use strict;
use warnings;

use PostgreSQL::Test::Utils;
use Test::More;

#########################################
# Basic checks

program_help_ok('pg_test_fsync');
program_version_ok('pg_test_fsync');
program_options_handling_ok('pg_test_fsync');

#########################################
# Test invalid option combinations

command_fails_like(
	[ 'pg_test_fsync', '--secs-per-test', 'a' ],
	qr/\Qpg_test_fsync: error: invalid argument for option --secs-per-test\E/,
	'pg_test_fsync: invalid argument for option --secs-per-test');
command_fails_like(
	[ 'pg_test_fsync', '--secs-per-test', '0' ],
	qr/\Qpg_test_fsync: error: --secs-per-test must be in range 1..4294967295\E/,
	'pg_test_fsync: --secs-per-test must be in range');

done_testing();