diff options
author | rillig <rillig@pkgsrc.org> | 2020-03-21 06:53:18 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2020-03-21 06:53:18 +0000 |
commit | 4ea6cf71794665d66ed99a37566417260e459caa (patch) | |
tree | 48e28afb4b87c0daeffe075ae4e02eb66bc55c4e /regress | |
parent | 5f43e1a1468c05cdd30045620b53be5df387f19b (diff) | |
download | pkgsrc-4ea6cf71794665d66ed99a37566417260e459caa.tar.gz |
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 (limited to 'regress')
-rw-r--r-- | regress/infra-unittests/subst.sh | 6 | ||||
-rw-r--r-- | regress/infra-unittests/test.subr | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/regress/infra-unittests/subst.sh b/regress/infra-unittests/subst.sh index b52562bca13..477870df2ad 100644 --- a/regress/infra-unittests/subst.sh +++ b/regress/infra-unittests/subst.sh @@ -499,11 +499,7 @@ EOF && 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 --git a/regress/infra-unittests/test.subr b/regress/infra-unittests/test.subr index 30a6c494b72..3f7f7da2cf8 100644 --- a/regress/infra-unittests/test.subr +++ b/regress/infra-unittests/test.subr @@ -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 @@ assert_that() { (--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 |