From b7608e07ba5bb6359118108aa744929bca5689c7 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Mon, 16 Nov 2026 12:49:51 +0100 Subject: [PATCH] test(roles): rank namespace check without double negation Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf --- internal/roles/dataset_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/roles/dataset_test.go b/internal/roles/dataset_test.go index b0ba4ff..2037897 100644 --- a/internal/roles/dataset_test.go +++ b/internal/roles/dataset_test.go @@ -67,7 +67,9 @@ func TestCatalogue_unionOfA1AndA4(t *testing.T) { rows[f.D02Row] = true } // Keys are namespaced by the rank that defines them (Nr. 2: R2, R5). - if !strings.HasPrefix(f.Code, "r1.") && !(slices.Contains(f.Sources, "B2") && (strings.HasPrefix(f.Code, "r2.") || strings.HasPrefix(f.Code, "r5."))) { + rank := strings.HasPrefix(f.Code, "r1.") || + slices.Contains(f.Sources, "B2") && (strings.HasPrefix(f.Code, "r2.") || strings.HasPrefix(f.Code, "r5.")) + if !rank { t.Errorf("%s: keys are namespaced by their rank", f.Code) } }