blob: 09d089c8aec9567a1fa0b9afb7d29ca18e29b9fd (
plain) (
blame)
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
30
31
32
|
#!./perl -w
use strict;
use Test::More;
require Fcntl;
# SEEK_SET intentionally included to test the skip functionality.
foreach my $symbol (qw(SEEK_SET O_BINARY S_ENFMT)) {
my $full_name = "Fcntl::$symbol";
if (defined eval $full_name) {
foreach my $code ($full_name, "$full_name()") {
my $value = eval $code;
like ($value, qr/^[0-9]+$/, "$code is defined on this system");
}
} else {
foreach my $code ($full_name, "$full_name()") {
my $value = eval $code;
like ($@,
qr/^Your vendor has not defined Fcntl macro $symbol, used at \(eval [0-9]+\) line 1\n\z/,
"Expected error message for $symbol, not defined on this system");
}
}
}
my $value = eval 'Fcntl::S_ISPIE()';
is($value, undef, "Fcntl::S_ISPIE isn't valid");
like ($@,
qr/^S_ISPIE is not a valid Fcntl macro at \(eval [0-9]+\) line 1\n\z/,
"Expected error message for S_ISPIE");
done_testing();
|