pkgsrc-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: fix a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2096861df3a6
branches:  trunk
changeset: 413571:2096861df3a6
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Mar 21 06:53:18 2020 +0000

description:
regress/infra-unittests: fix assertion --file-is-lines

It had compared the actual output with itself, instead of comparing it to
the expected output.

diffstat:

 regress/infra-unittests/subst.sh  |  6 +-----
 regress/infra-unittests/test.subr |  6 +++---
 2 files changed, 4 insertions(+), 8 deletions(-)

diffs (37 lines):

diff -r 64aa416173d5 -r 2096861df3a6 regress/infra-unittests/subst.sh
--- a/regress/infra-unittests/subst.sh  Sat Mar 21 00:15:11 2020 +0000
+++ b/regress/infra-unittests/subst.sh  Sat Mar 21 06:53:18 2020 +0000
@@ -499,11 +499,7 @@
        && exitcode=0 || exitcode=$?
 
        assert_that "stdout" --file-is-lines \
-               '=> Substituting "class" in *' \
-               'info: [subst.mk:class] Nothing changed in ./prepare-subst.mk.' \
-               'info: [subst.mk:class] Nothing changed in ./stderr.' \
-               'info: [subst.mk:class] Nothing changed in ./stdout.' \
-               'info: [subst.mk:class] Nothing changed in ./test.subr.main.mk.'
+               '=> Substituting "class" in [*]'
        assert_that "stderr" --file-is-empty
        assert_that "$exitcode" --equals "0"
 
diff -r 64aa416173d5 -r 2096861df3a6 regress/infra-unittests/test.subr
--- a/regress/infra-unittests/test.subr Sat Mar 21 00:15:11 2020 +0000
+++ b/regress/infra-unittests/test.subr Sat Mar 21 06:53:18 2020 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: test.subr,v 1.4 2020/03/20 21:27:04 rillig Exp $
+# $NetBSD: test.subr,v 1.5 2020/03/21 06:53:18 rillig Exp $
 set -eu
 
 # This file defines utilities for testing Makefile fragments in a mocked
@@ -233,8 +233,8 @@
 
        (--file-is-lines)
                _assert_that_tmp_actual="$tmpdir/$1"
-               _assert_that_tmp_expected="$tmpdir/$1"
-               _assert_that_filename="$1"; shift
+               _assert_that_tmp_expected="$tmpdir/expected"
+               _assert_that_filename="$1"; shift 2
 
                printf '%s\n' "$@" > "$_assert_that_tmp_expected"
                if diff -u "$_assert_that_tmp_expected" "$_assert_that_tmp_actual" > /dev/null; then



Home | Main Index | Thread Index | Old Index