summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cfg.mk5
-rwxr-xr-xtests/misc/join4
-rwxr-xr-xtests/misc/sort4
-rwxr-xr-xtests/misc/sort-merge2
-rwxr-xr-xtests/misc/test6
-rwxr-xr-xtests/misc/unexpand2
-rwxr-xr-xtests/misc/uniq4
7 files changed, 16 insertions, 11 deletions
diff --git a/cfg.mk b/cfg.mk
index ae05f8c52..dff5de5d9 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -233,6 +233,11 @@ sc_require_stdio_safer:
else :; \
fi
+sc_prohibit_perl_hash_quotes:
+ @prohibit="\{'[A-Z_]+' *[=}]" \
+ halt="in Perl code, write \$$hash{KEY}, not \$$hash{'K''EY'}" \
+ $(_sc_search_regexp)
+
# Prefer xnanosleep over other less-precise sleep methods
sc_prohibit_sleep:
@prohibit='\<(nano|u)?sleep \(' \
diff --git a/tests/misc/join b/tests/misc/join
index cef813773..0e34ba867 100755
--- a/tests/misc/join
+++ b/tests/misc/join
@@ -146,9 +146,9 @@ my @tv = (
t_subst "a:1:2:\nb:1:2:\n", 0],
# fields > SIZE_MAX are silently interpreted as SIZE_MAX
-['bigfield1', "-1 $limits->{'UINTMAX_OFLOW'} -2 2",
+['bigfield1', "-1 $limits->{UINTMAX_OFLOW} -2 2",
["a\n", "b\n"], " a b\n", 0],
-['bigfield2', "-1 $limits->{'SIZE_OFLOW'} -2 2",
+['bigfield2', "-1 $limits->{SIZE_OFLOW} -2 2",
["a\n", "b\n"], " a b\n", 0],
# FIXME: change this to ensure the diagnostic makes sense
diff --git a/tests/misc/sort b/tests/misc/sort
index 4ca52fe9c..0b098452d 100755
--- a/tests/misc/sort
+++ b/tests/misc/sort
@@ -353,9 +353,9 @@ my @Tests =
{IN=>"a\0z\01\nb\0y\02\n"}, {OUT=>"b\0y\02\na\0z\01\n"}],
# fields > SIZE_MAX are silently interpreted as SIZE_MAX
-["bigfield1", "-k $limits->{'UINTMAX_OFLOW'}",
+["bigfield1", "-k $limits->{UINTMAX_OFLOW}",
{IN=>"2\n1\n"}, {OUT=>"1\n2\n"}],
-["bigfield2", "-k $limits->{'SIZE_OFLOW'}",
+["bigfield2", "-k $limits->{SIZE_OFLOW}",
{IN=>"2\n1\n"}, {OUT=>"1\n2\n"}],
# Using an old-style key-specifying option like +1 with an invalid
diff --git a/tests/misc/sort-merge b/tests/misc/sort-merge
index 70fc7b4ec..c659505a8 100755
--- a/tests/misc/sort-merge
+++ b/tests/misc/sort-merge
@@ -34,7 +34,7 @@ my $big_input = "aaa\n" x 1024;
# don't need to check for existence, since we're running in a temp dir
my $badtmp = 'does/not/exist';
-my $bigint = $limits->{'UINTMAX_OFLOW'};
+my $bigint = $limits->{UINTMAX_OFLOW};
my @Tests =
(
diff --git a/tests/misc/test b/tests/misc/test
index 799bff0ca..da33de795 100755
--- a/tests/misc/test
+++ b/tests/misc/test
@@ -158,19 +158,19 @@ my @Tests =
['eq-3', qw(0 -eq 00)],
['eq-4', qw(8 -eq 9), {EXIT=>1}],
['eq-5', qw(1 -eq 0), {EXIT=>1}],
- ['eq-6', "$limits->{'UINTMAX_OFLOW'} -eq 0", {EXIT=>1}],
+ ['eq-6', "$limits->{UINTMAX_OFLOW} -eq 0", {EXIT=>1}],
['gt-1', qw(5 -gt 5), {EXIT=>1}],
['gt-2', qw(5 -gt 4)],
['gt-3', qw(4 -gt 5), {EXIT=>1}],
['gt-4', qw(-1 -gt -2)],
- ['gt-5', "$limits->{'UINTMAX_OFLOW'} -gt $limits->{'INTMAX_UFLOW'}"],
+ ['gt-5', "$limits->{UINTMAX_OFLOW} -gt $limits->{INTMAX_UFLOW}"],
['lt-1', qw(5 -lt 5), {EXIT=>1}],
['lt-2', qw(5 -lt 4), {EXIT=>1}],
['lt-3', qw(4 -lt 5)],
['lt-4', qw(-1 -lt -2), {EXIT=>1}],
- ['lt-5', "$limits->{'INTMAX_UFLOW'} -lt $limits->{'UINTMAX_OFLOW'}"],
+ ['lt-5', "$limits->{INTMAX_UFLOW} -lt $limits->{UINTMAX_OFLOW}"],
['inv-1', qw(0x0 -eq 00), {EXIT=>2},
{ERR=>"$prog: invalid integer `0x0'\n"}],
diff --git a/tests/misc/unexpand b/tests/misc/unexpand
index 327db9ec9..d98da5837 100755
--- a/tests/misc/unexpand
+++ b/tests/misc/unexpand
@@ -78,7 +78,7 @@ my @Tests =
# It is debatable whether this test should require an environment
# setting of e.g., _POSIX2_VERSION=1.
- ['obs-ovflo', "-$limits->{'UINTMAX_OFLOW'}", {IN=>''}, {OUT=>''},
+ ['obs-ovflo', "-$limits->{UINTMAX_OFLOW}", {IN=>''}, {OUT=>''},
{EXIT => 1}, {ERR => "$prog: tab stop value is too large\n"}],
);
diff --git a/tests/misc/uniq b/tests/misc/uniq
index e49fe756d..4d1f8a4ff 100755
--- a/tests/misc/uniq
+++ b/tests/misc/uniq
@@ -194,8 +194,8 @@ my @Tests =
. $try}],
# Check that -d and -u suppress all output, as POSIX requires.
['120', qw(-d -u), {IN=>"a\na\n\b"}, {OUT=>""}],
- ['121', "-d -u -w$limits->{'UINTMAX_OFLOW'}", {IN=>"a\na\n\b"}, {OUT=>""}],
- ['122', "-d -u -w$limits->{'SIZE_OFLOW'}", {IN=>"a\na\n\b"}, {OUT=>""}],
+ ['121', "-d -u -w$limits->{UINTMAX_OFLOW}", {IN=>"a\na\n\b"}, {OUT=>""}],
+ ['122', "-d -u -w$limits->{SIZE_OFLOW}", {IN=>"a\na\n\b"}, {OUT=>""}],
# Check that --zero-terminated is synonymous with -z.
['123', '--zero-terminated', {IN=>"a\na\nb"}, {OUT=>"a\na\nb\0"}],
['124', '--zero-terminated', {IN=>"a\0a\0b"}, {OUT=>"a\0b\0"}],