Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/usr.bin/awk add a range and a repeat regex test.
details: https://anonhg.NetBSD.org/src/rev/3c9510d6a7d2
branches: trunk
changeset: 447613:3c9510d6a7d2
user: christos <christos%NetBSD.org@localhost>
date: Sat Jan 19 01:02:12 2019 +0000
description:
add a range and a repeat regex test.
diffstat:
tests/usr.bin/awk/t_awk.sh | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diffs (48 lines):
diff -r d5c96b8c8387 -r 3c9510d6a7d2 tests/usr.bin/awk/t_awk.sh
--- a/tests/usr.bin/awk/t_awk.sh Sat Jan 19 00:37:41 2019 +0000
+++ b/tests/usr.bin/awk/t_awk.sh Sat Jan 19 01:02:12 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_awk.sh,v 1.5 2012/12/10 20:30:06 christos Exp $
+# $NetBSD: t_awk.sh,v 1.6 2019/01/19 01:02:12 christos Exp $
#
# Copyright (c) 2012 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -335,6 +335,30 @@
-x "printf '\n\n\nr1f1\nr1f2\n\nr2f1\nr2f2\n\n\n' | $awk '{\$1=\$1}1' RS= OFS=:"
}
+atf_test_case regex_range
+
+regex_range_head() {
+ atf_set "descr" "Test awk(1) with regex range"
+}
+
+regex_range_body() {
+ atf_check \
+ -o "inline:matched\n" \
+ -x "echo '1 a' | $awk '/[[:digit:]][[:space:]][[:alpha:]]/ { print \"matched\"; }'"
+}
+
+atf_test_case regex_repeat
+
+regex_repeat_head() {
+ atf_set "descr" "Test awk(1) with regex repeat"
+}
+
+regex_repeat_body() {
+ atf_check \
+ -o "inline:matched\n" \
+ -x "echo 'aaabbbbcc' | $awk '/a{3}b{4}c{2}/ { print \"matched\"; }'"
+}
+
atf_test_case modify_subsep
modify_subsep_head() {
@@ -374,5 +398,7 @@
atf_add_test_case regex_reallocation_rs
atf_add_test_case empty_rs
atf_add_test_case newline_rs
+ atf_add_test_case regex_range
+ atf_add_test_case regex_repeat
atf_add_test_case modify_subsep
}
Home |
Main Index |
Thread Index |
Old Index