From 2efbcfc53f142ef656ce317e5fab79a03310b8b0 Mon Sep 17 00:00:00 2001 From: Rootiest Date: Mon, 7 Sep 2026 20:10:15 -0400 Subject: [PATCH] test(guards): cover registry lookup, including identity:site pairing 5 cases. The wrong-site case pins that the key is the identity:site pair rather than the identity alone. --- tests/test-guards.fish | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test-guards.fish b/tests/test-guards.fish index ee02581..c84f3e3 100644 --- a/tests/test-guards.fish +++ b/tests/test-guards.fish @@ -187,4 +187,22 @@ __fish_config_op_cascade __fish_config_op_logging __fish_config_op_logging_termi check "C5 sub falsy, C5 truthy -> disabled" 1 $status set -e __fish_config_op_logging_terminal_capture __fish_config_op_logging +section "registry lookup" + +__fish_config_op_registry_lookup cat "" >/dev/null +check "known unsited key found" 0 $status + +set -l t (__fish_config_op_registry_lookup cat "") +check "cat's tags" aliases/filesystem "$t" + +__fish_config_op_registry_lookup nosuchthing "" >/dev/null +check "unknown identity -> not found" 1 $status + +set -l t2 (__fish_config_op_registry_lookup config cdpath) +check "sited key config:cdpath" overrides/environment "$t2" + +# The key is the identity:site PAIR, not the identity alone. +__fish_config_op_registry_lookup cat wrongsite >/dev/null +check "known identity, wrong site -> not found" 1 $status + report