From f94fb57534e625dc8f9b34508dcf22cb731697e2 Mon Sep 17 00:00:00 2001 From: alnsn Date: Thu, 28 Apr 2011 23:28:23 +0000 Subject: [PATCH] Test for PR bin/42320. --- tests/util/awk/d_period.awk | 1 + tests/util/awk/d_period.in | 1 + tests/util/awk/d_period.out | 1 + tests/util/awk/t_awk.sh | 22 +++++++++++++++++++--- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 tests/util/awk/d_period.awk create mode 100644 tests/util/awk/d_period.in create mode 100644 tests/util/awk/d_period.out diff --git a/tests/util/awk/d_period.awk b/tests/util/awk/d_period.awk new file mode 100644 index 000000000000..d1dabf751304 --- /dev/null +++ b/tests/util/awk/d_period.awk @@ -0,0 +1 @@ +{print x + $1 + 0.125} diff --git a/tests/util/awk/d_period.in b/tests/util/awk/d_period.in new file mode 100644 index 000000000000..d10c0e2f9d08 --- /dev/null +++ b/tests/util/awk/d_period.in @@ -0,0 +1 @@ +0,25 diff --git a/tests/util/awk/d_period.out b/tests/util/awk/d_period.out new file mode 100644 index 000000000000..409b777d8a16 --- /dev/null +++ b/tests/util/awk/d_period.out @@ -0,0 +1 @@ +0,875 diff --git a/tests/util/awk/t_awk.sh b/tests/util/awk/t_awk.sh index 93b511368900..175eb4a105a3 100644 --- a/tests/util/awk/t_awk.sh +++ b/tests/util/awk/t_awk.sh @@ -1,4 +1,4 @@ -# $NetBSD: t_awk.sh,v 1.3 2010/11/07 17:51:22 jmmv Exp $ +# $NetBSD: t_awk.sh,v 1.4 2011/04/28 23:28:23 alnsn Exp $ # # Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. # All rights reserved. @@ -27,10 +27,12 @@ h_check() { + local fname=d_$1 for sfx in in out awk; do - cp -r $(atf_get_srcdir)/d_$1.$sfx . + cp -r $(atf_get_srcdir)/$fname.$sfx . done - atf_check -o file:d_$1.out -x "awk -f d_$1.awk < d_$1.in" + shift 1 + atf_check -o file:$fname.out -x "awk $@ -f $fname.awk < $fname.in" } atf_test_case big_regexp @@ -82,10 +84,24 @@ multibyte_body() h_check toupper } +atf_test_case period +period_head() +{ + atf_set "descr" "Checks that the period character is recognised" \ + "in awk program regardless of locale (bin/42320)" +} +period_body() +{ + export LANG=ru_RU.KOI8-R + + h_check period -v x=0.5 +} + atf_init_test_cases() { atf_add_test_case big_regexp atf_add_test_case end atf_add_test_case string1 atf_add_test_case multibyte + atf_add_test_case period }