Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/xlint/lint2 tests/lint2: fix regular expressio...



details:   https://anonhg.NetBSD.org/src/rev/e82934fe80d5
branches:  trunk
changeset: 1026538:e82934fe80d5
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 28 09:10:36 2021 +0000

description:
tests/lint2: fix regular expressions containing backslash

In regular expressions, a backslash must be doubled. In this case, ATF
didn't complain because the single backslashes were used in the pattern
'\($2\)', where they produced '\(...\\)'. Omitting the backslash for the
closing parenthesis was apparently OK; other regex implementations
complain about this.

diffstat:

 tests/usr.bin/xlint/lint2/t_lint2.sh |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 8de23aa80abb -r e82934fe80d5 tests/usr.bin/xlint/lint2/t_lint2.sh
--- a/tests/usr.bin/xlint/lint2/t_lint2.sh      Sun Nov 28 08:21:49 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/t_lint2.sh      Sun Nov 28 09:10:36 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_lint2.sh,v 1.8 2021/09/05 18:17:15 rillig Exp $
+# $NetBSD: t_lint2.sh,v 1.9 2021/11/28 09:10:36 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -141,9 +141,9 @@
        test_error '0c0.0s2"'           'trailing data: '
        test_error '0c0.0s2"%'          'missing closing quote'
        # shellcheck disable=SC1003
-       test_error '0c0.0s2"\'          'missing after \'
+       test_error '0c0.0s2"\'          'missing after \\'
        # shellcheck disable=SC1003
-       test_error '0c0.0s2"%\'         'missing after \'
+       test_error '0c0.0s2"%\'         'missing after \\'
 
        # declarations and definitions
        test_error '0d0'                'bad line number'



Home | Main Index | Thread Index | Old Index