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: clean up test driver



details:   https://anonhg.NetBSD.org/src/rev/f38ddae59136
branches:  trunk
changeset: 375907:f38ddae59136
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat May 20 17:31:53 2023 +0000

description:
tests/indent: clean up test driver

No functional change.

diffstat:

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

diffs (52 lines):

diff -r fe5519b240a5 -r f38ddae59136 tests/usr.bin/indent/t_options.awk
--- a/tests/usr.bin/indent/t_options.awk        Sat May 20 16:31:31 2023 +0000
+++ b/tests/usr.bin/indent/t_options.awk        Sat May 20 17:31:53 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_options.awk,v 1.12 2023/05/15 17:38:56 rillig Exp $
+# $NetBSD: t_options.awk,v 1.13 2023/05/20 17:31:53 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -85,11 +85,6 @@ function warn(lineno, msg)
        warned = 1
 }
 
-function quote(s)
-{
-       return "'" s "'"
-}
-
 function check_empty_lines_block(n)
 {
        if (max_empty_lines != n && seen_input_section)
@@ -160,7 +155,7 @@ section == "" {
 
        } else if ($2 == "run") {
                if (section != "")
-                       warn(NR, "unfinished section " quote(section))
+                       warn(NR, "unfinished section '" section "'")
                check_empty_lines_block(1)
                if (prev_empty_lines != 1)
                        warn(NR, "run section needs 1 empty line above, " \
@@ -209,10 +204,10 @@ section == "" {
                max_empty_lines = 0
 
        } else if ($2 == "end") {
-               warn(NR, "misplaced " quote("//indent end"))
+               warn(NR, "misplaced '//indent end'")
 
        } else {
-               die(NR, "invalid line " quote($0))
+               die(NR, "invalid line '" $0 "'")
        }
 
        prev_empty_lines = 0
@@ -235,7 +230,7 @@ section == "" && !/^$/ && !/^#/ && !/^\/
 
 END {
        if (section != "")
-               die(NR, "still in section " quote(section))
+               die(NR, "still in section '" section "'")
        check_unused_input()
        if (warned)
                exit(1)



Home | Main Index | Thread Index | Old Index