From e19ba584463750301836dc5edd8cf2835fca1542 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 19 Nov 2019 00:49:54 +0000 Subject: [PATCH] tests: Introduce `diff' proc No functional change. Signed-off-by: Ian Jackson --- mtest/common.tcl | 12 ++++++++---- mtest/t-basic | 5 +---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mtest/common.tcl b/mtest/common.tcl index e3b67c4..a016dae 100644 --- a/mtest/common.tcl +++ b/mtest/common.tcl @@ -17,13 +17,17 @@ proc run-mss-userv {user group args} { proc run-mss {args} { eval [list exec] [mss-program] $args } +proc diff {a b seddery} { + exec bash -c " + diff -u <($seddery $a) \\ + <($seddery $b) + " +} + proc diff-output {expected got suffix} { global seddery global tmp - exec bash -c " - diff -u <($seddery mtest/$expected$suffix) \\ - <($seddery $tmp/$got$suffix ) - " + diff mtest/$expected$suffix $tmp/$got$suffix $seddery } file mkdir $tmp/groupfiles diff --git a/mtest/t-basic b/mtest/t-basic index e3ced5a..ad754c1 100755 --- a/mtest/t-basic +++ b/mtest/t-basic @@ -5,7 +5,4 @@ source mtest/common.tcl run-mss --no-conf-key-prefix test-example/sites $tmp/out.conf set seddery { sed -n 's/^[ \t]*//; /^[^#]/p' } -exec bash -c " - diff -u <($seddery mtest/e-basic.conf) \\ - <($seddery $tmp/out.conf ) -" +diff mtest/e-basic.conf $tmp/out.conf $seddery -- 2.30.2