Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/indent tests/indent: prevent non-comment text ...



details:   https://anonhg.NetBSD.org/src/rev/bcfa2a5b0a97
branches:  trunk
changeset: 990018:bcfa2a5b0a97
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 23 20:35:18 2021 +0000

description:
tests/indent: prevent non-comment text to be ignored in the tests

diffstat:

 tests/usr.bin/indent/t_options.awk |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 3c799d7054dd -r bcfa2a5b0a97 tests/usr.bin/indent/t_options.awk
--- a/tests/usr.bin/indent/t_options.awk        Sat Oct 23 20:30:23 2021 +0000
+++ b/tests/usr.bin/indent/t_options.awk        Sat Oct 23 20:35:18 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_options.awk,v 1.1 2021/10/18 20:18:00 rillig Exp $
+# $NetBSD: t_options.awk,v 1.2 2021/10/23 20:35:18 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -183,6 +183,10 @@
        print $0 > "expected.out"
 }
 
+section == "" && !/^$/ && !/^#/ && !/^\// && !/^ \*/ {
+       warn(NR, "non-comment line outside 'input' or 'run' section")
+}
+
 END {
        if (section != "")
                die(NR, "still in section " quote(section))



Home | Main Index | Thread Index | Old Index