chiark / gitweb /
Test suite: Make t-refs-same* not wrongly ignore some nonexistent refs
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Oct 2016 14:39:14 +0000 (14:39 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Oct 2016 19:50:48 +0000 (19:50 +0000)
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>
tests/lib

index 03bb12da073636c7b17868cd2ddd895c847bd5f4..401331a2a8378eeca25aded59e15de76475fb8e5 100644 (file)
--- 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 () {