Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/util/awk Test for PR bin/42320.



details:   https://anonhg.NetBSD.org/src/rev/975cad3c3b87
branches:  trunk
changeset: 764613:975cad3c3b87
user:      alnsn <alnsn%NetBSD.org@localhost>
date:      Thu Apr 28 23:28:23 2011 +0000

description:
Test for PR bin/42320.

diffstat:

 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(-)

diffs (64 lines):

diff -r 89f9a1b89e76 -r 975cad3c3b87 tests/util/awk/d_period.awk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/util/awk/d_period.awk       Thu Apr 28 23:28:23 2011 +0000
@@ -0,0 +1,1 @@
+{print x + $1 + 0.125}
diff -r 89f9a1b89e76 -r 975cad3c3b87 tests/util/awk/d_period.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/util/awk/d_period.in        Thu Apr 28 23:28:23 2011 +0000
@@ -0,0 +1,1 @@
+0,25
diff -r 89f9a1b89e76 -r 975cad3c3b87 tests/util/awk/d_period.out
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/util/awk/d_period.out       Thu Apr 28 23:28:23 2011 +0000
@@ -0,0 +1,1 @@
+0,875
diff -r 89f9a1b89e76 -r 975cad3c3b87 tests/util/awk/t_awk.sh
--- a/tests/util/awk/t_awk.sh   Thu Apr 28 23:28:11 2011 +0000
+++ b/tests/util/awk/t_awk.sh   Thu Apr 28 23:28:23 2011 +0000
@@ -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 @@
        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
 }



Home | Main Index | Thread Index | Old Index