From cd50f9c3ca13efec84cc82fc20798e883fa6ba97 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 30 Oct 2016 14:39:14 +0000 Subject: [PATCH] Test suite: Make t-refs-same* not wrongly ignore some nonexistent refs Previously, t_ref_val="" was meant to mean "no refs specified yet" but could also arise from "ref was specified but did not exist". Distinguish these two cases, by using t_ref_val="" to mean only the latter. "No refs specified yet" is represented as t_ref_val unset. Signed-off-by: Ian Jackson --- tests/lib | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/lib b/tests/lib index 03bb12da..401331a2 100644 --- a/tests/lib +++ b/tests/lib @@ -489,8 +489,8 @@ t-ref-head () { t-ref-same-val () { local name="$1" local val=$2 - case "$t_ref_val" in - '') ;; + case "${t_ref_val-unset}" in + unset) ;; "$val") ;; *) fail "ref varies: $name:\ ${val:-nothing} != ${t_ref_val:-nothing}" ;; @@ -499,7 +499,7 @@ t-ref-same-val () { } t-refs-same-start () { - t_ref_val='' + unset t_ref_val } t-refs-same () { -- 2.30.2