summaryrefslogtreecommitdiff
path: root/tests/lib
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-30 14:39:14 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-30 19:50:48 +0000
commitcd50f9c3ca13efec84cc82fc20798e883fa6ba97 (patch)
tree54199796c482c3553af19c0e04ccad204c3dc369 /tests/lib
parent4ef9b0ee8c0e7dd58fab89ad4ec7b660f2ab7e0f (diff)
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 <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/lib b/tests/lib
index 03bb12d..401331a 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 () {