Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/regress/infra-unittests regress/infra-unittests: repla...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f21cb7d02ab2
branches:  trunk
changeset: 431313:f21cb7d02ab2
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue May 12 04:22:44 2020 +0000

description:
regress/infra-unittests: replace remaining double with single quotes

diffstat:

 regress/infra-unittests/subst.sh |  177 +++++++++++++++++++-------------------
 1 files changed, 88 insertions(+), 89 deletions(-)

diffs (truncated from 502 to 300 lines):

diff -r 59d0ba05c599 -r f21cb7d02ab2 regress/infra-unittests/subst.sh
--- a/regress/infra-unittests/subst.sh  Tue May 12 03:26:16 2020 +0000
+++ b/regress/infra-unittests/subst.sh  Tue May 12 04:22:44 2020 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: subst.sh,v 1.37 2020/05/11 20:22:31 rillig Exp $
+# $NetBSD: subst.sh,v 1.38 2020/05/12 04:22:44 rillig Exp $
 #
 # Tests for mk/subst.mk.
 #
@@ -32,11 +32,11 @@
 
                # Commands that are specific to pkgsrc
                RUN=            @set -e;
-               STEP_MSG=       echo "=>"
+               STEP_MSG=       echo '=>'
                DO_NADA=        : do-nada
-               INFO_MSG=       echo "info:"
-               WARNING_MSG=    echo "warning:"
-               FAIL_MSG=       sh $pkgsrcdir/mk/scripts/fail echo "fail:"
+               INFO_MSG=       echo 'info:'
+               WARNING_MSG=    echo 'warning:'
+               FAIL_MSG=       sh $pkgsrcdir/mk/scripts/fail echo 'fail:'
 
                WRKDIR=         $tmpdir/wrkdir
                WRKSRC=         .
@@ -71,7 +71,7 @@
        run_bmake 'subst-single.mk' > "$tmpdir/output"
 
        assert_that "$tmpdir/output" --file-contains-exactly \
-               "=> Substituting \"class\" in subst-single.txt"
+               '=> Substituting "class" in subst-single.txt'
        assert_that 'subst-single.txt' --file-contains-exactly \
                'after'
 
@@ -102,7 +102,7 @@
        run_bmake 'testcase.mk' > "$tmpdir/output"
 
        assert_that "$tmpdir/output" --file-is-lines \
-               "=> Substituting \"class\" in first second third"
+               '=> Substituting "class" in first second third'
        assert_that 'first' --file-contains-exactly 'the first example'
        assert_that 'second' --file-contains-exactly 'the second example'
        assert_that 'third' --file-contains-exactly 'the third example'
@@ -134,7 +134,7 @@
 
        output=$(run_bmake 'testcase.mk')
 
-       assert_that "$output" --equals "=> Substituting \"class\" in pattern-*"
+       assert_that "$output" --equals '=> Substituting "class" in pattern-*'
        assert_that 'pattern-first' --file-contains-exactly 'the first example'
        assert_that 'pattern-second' --file-contains-exactly 'the second example'
        assert_that 'pattern-third' --file-contains-exactly 'the third example'
@@ -169,11 +169,10 @@
        create_file_lines 'pattern-third'       'the third file'
 
        run_bmake 'testcase.mk' > "$tmpdir/output"
-       create_file_lines 'expected-output' \
+
+       assert_that "$tmpdir/output" --file-is-lines \
                '=> Substituting "class" in pattern-*' \
                'info: [subst.mk:class] Nothing changed in "pattern-second".'
-
-       assert_that "$tmpdir/output" --file-equals "expected-output"
        assert_that 'pattern-first' --file-contains-exactly 'the first example'
        assert_that 'pattern-second' --file-contains-exactly 'the second is already an example'
        assert_that 'pattern-third' --file-contains-exactly 'the third example'
@@ -182,7 +181,7 @@
 fi
 
 
-if test_case_begin "single file noop, noop_ok=yes"; then
+if test_case_begin 'single file noop, noop_ok=yes'; then
 
        create_file 'testcase.mk' <<-EOF
                SUBST_CLASSES+=         class
@@ -206,13 +205,13 @@
                '=> Substituting "class" in single' \
                'info: [subst.mk:class] Nothing changed in "single".'
        assert_that 'single' --file-contains-exactly 'already an example'
-       assert_that "$exitcode" --equals "0"
+       assert_that "$exitcode" --equals '0'
 
        test_case_end
 fi
 
 
-if test_case_begin "single file noop, noop_ok=no"; then
+if test_case_begin 'single file noop, noop_ok=no'; then
 
        create_file 'testcase.mk' <<-EOF
                SUBST_CLASSES+=         class
@@ -242,7 +241,7 @@
                "$make: stopped in $PWD"
        assert_that "$tmpdir/output" --file-equals 'expected-output'
        assert_that 'single' --file-contains-exactly 'already an example'
-       assert_that "$exitcode" --equals "1"
+       assert_that "$exitcode" --equals '1'
 
        test_case_end
 fi
@@ -274,7 +273,7 @@
                '' \
                'Stop.' \
                "$make: stopped in $PWD"
-       assert_that "$exitcode" --equals "1"
+       assert_that "$exitcode" --equals '1'
 
        test_case_end
 fi
@@ -301,13 +300,13 @@
        assert_that "$tmpdir/output" --file-is-lines \
                '=> Substituting "class" in nonexistent' \
                'info: [subst.mk:class] Ignoring nonexistent file "nonexistent".'
-       assert_that "$exitcode" --equals "0"
+       assert_that "$exitcode" --equals '0'
 
        test_case_end
 fi
 
 
-if test_case_begin "several patterns, 1 nonexistent"; then
+if test_case_begin 'several patterns, 1 nonexistent'; then
 
        create_file 'testcase.mk' <<-EOF
                SUBST_CLASSES+=         class
@@ -336,7 +335,7 @@
 fi
 
 
-if test_case_begin "multiple missing files, all are reported at once"; then
+if test_case_begin 'multiple missing files, all are reported at once'; then
 
        create_file 'testcase.mk' <<-EOF
                SUBST_CLASSES+=         class
@@ -362,7 +361,7 @@
 fi
 
 
-if test_case_begin "multiple no-op files, all are reported at once"; then
+if test_case_begin 'multiple no-op files, all are reported at once'; then
 
        create_file 'testcase.mk' <<-EOF
                SUBST_CLASSES+=         class
@@ -417,9 +416,9 @@
 \${_SUBST_COOKIE.class}: prepare-subst-class
 prepare-subst-class:
        \${RUN} \${MKDIR} \${WRKSRC}
-       \${RUN} \${ECHO} "from" > "\${WRKSRC}/first"
-       \${RUN} \${ECHO} "from" > "\${WRKSRC}/second"
-       \${RUN} \${ECHO} "from" > "\${WRKSRC}/third"
+       \${RUN} \${ECHO} 'from' > '\${WRKSRC}/first'
+       \${RUN} \${ECHO} 'from' > '\${WRKSRC}/second'
+       \${RUN} \${ECHO} 'from' > '\${WRKSRC}/third'
 EOF
 
        run_bmake 'testcase.mk' 'subst-class' \
@@ -499,8 +498,8 @@
 
        create_file_lines 'any' 'before'
        create_file_lines 'x'   'before'
-       create_file_lines "*"   'before'
-       create_file_lines "[*]" 'before'
+       create_file_lines '*'   'before'
+       create_file_lines '[*]' 'before'
 
        run_bmake 'testcase.mk' 'subst-class' \
                1> "$tmpdir/stdout" \
@@ -514,8 +513,8 @@
 
        assert_that 'any'       --file-is-lines 'before'
        assert_that 'x'         --file-is-lines 'before'
-       assert_that "*"         --file-is-lines 'after'
-       assert_that "[*]"       --file-is-lines 'before'
+       assert_that '*'         --file-is-lines 'after'
+       assert_that '[*]'       --file-is-lines 'before'
 
        test_case_end
 fi
@@ -542,8 +541,8 @@
 
        assert_that "$tmpdir/stdout" --file-is-empty
        assert_that "$tmpdir/stderr" --file-is-lines \
-               "fail reason: [subst.mk] duplicate SUBST class in: one one two"
-       assert_that "$exitcode" --equals 0
+               'fail reason: [subst.mk] duplicate SUBST class in: one one two'
+       assert_that "$exitcode" --equals '0'
 
        test_case_end
 fi
@@ -586,11 +585,11 @@
 
        assert_that 'file' --file-is-lines 'zero I II III four'
        assert_that "$tmpdir/stdout-sorted" --file-is-lines \
-               "=> Substituting \"one\" in file" \
-               "=> Substituting \"three\" in file" \
-               "=> Substituting \"two\" in file"
+               '=> Substituting "one" in file' \
+               '=> Substituting "three" in file' \
+               '=> Substituting "two" in file'
        assert_that "$tmpdir/stderr" --file-is-empty
-       assert_that "$exitcode" --equals 0
+       assert_that "$exitcode" --equals '0'
 
        test_case_end
 fi
@@ -622,16 +621,16 @@
 
        assert_that 'file' --file-is-lines 'one' 'II' 'three'
        assert_that "$tmpdir/stdout-filtered" --file-is-lines \
-               "=> Substituting \"two\" in file" \
-               "--- file (filtered timestamp)" \
-               "+++ file.subst.sav (filtered timestamp)" \
-               "@@ -1,3 +1,3 @@" \
+               '=> Substituting "two" in file' \
+               '--- file (filtered timestamp)' \
+               '+++ file.subst.sav (filtered timestamp)' \
+               '@@ -1,3 +1,3 @@' \
                ' one' \
                '-two' \
-               "+II" \
+               '+II' \
                ' three'
        assert_that "$tmpdir/stderr" --file-is-empty
-       assert_that "$exitcode" --equals 0
+       assert_that "$exitcode" --equals '0'
 
        test_case_end
 fi
@@ -662,16 +661,16 @@
 
        assert_that 'file' --file-is-lines 'one' 'II' 'three'
        assert_that "$tmpdir/stdout-filtered" --file-is-lines \
-               "=> Substituting \"two\" in file" \
-               "--- file (filtered timestamp)" \
-               "+++ file.subst.sav (filtered timestamp)" \
-               "@@ -1,3 +1,3 @@" \
+               '=> Substituting "two" in file' \
+               '--- file (filtered timestamp)' \
+               '+++ file.subst.sav (filtered timestamp)' \
+               '@@ -1,3 +1,3 @@' \
                ' one' \
                '-two' \
-               "+II" \
+               '+II' \
                ' three'
        assert_that "$tmpdir/stderr" --file-is-empty
-       assert_that "$exitcode" --equals 0
+       assert_that "$exitcode" --equals '0'
 
        test_case_end
 fi
@@ -696,12 +695,12 @@
                '.include "prepare-subst.mk"' \
                '.include "mk/subst.mk"'
        create_file_lines 'vars.txt' \
-               "@PLAIN@" \
-               "@DQUOT@" \
-               "@SQUOT@" \
-               "@DELIM@" \
-               "@PRINTABLE@" \
-               "@UNDEFINED@"
+               '@PLAIN@' \
+               '@DQUOT@' \
+               '@SQUOT@' \
+               '@DELIM@' \
+               '@PRINTABLE@' \
+               '@UNDEFINED@'
 
        run_bmake 'testcase.mk' 'pre-configure' \
                1> "$tmpdir/stdout" \
@@ -713,15 +712,15 @@
        # words. In these string variables, the quotes are part of the value.
        assert_that 'vars.txt' --file-is-lines \
                'plain' \
-               "\"double   quoted\"" \
+               '"double   quoted"' \
                "'single   quoted'" \
-               "hello,   world" \
+               'hello,   world' \
                '!"#$%&'\''()*+,-./09:;<=>?@AZ[\]^_`az{|}' \
                ''
        assert_that "$tmpdir/stdout" --file-is-lines \
-               "=> Substituting \"vars\" in vars.txt"
+               '=> Substituting "vars" in vars.txt'
        assert_that "$tmpdir/stderr" --file-is-empty
-       assert_that "$exitcode" --equals 0
+       assert_that "$exitcode" --equals '0'
 
        test_case_end
 fi
@@ -744,9 +743,9 @@
                '.include "prepare-subst.mk"' \
                '.include "mk/subst.mk"'
        create_file_lines 'vars.txt' \
-               "@SPACE@" \
-               "@TAB@" \
-               "@NEWLINE@"
+               '@SPACE@' \
+               '@TAB@' \



Home | Main Index | Thread Index | Old Index