From 2082df948fc623eceadf47662e71b008ef125642 Mon Sep 17 00:00:00 2001 From: xstudio agent Date: Mon, 28 Sep 2026 21:10:05 +0800 Subject: [PATCH] test(dth:sp1-more): fix BSD wc whitespace in TDS token 3-parts assertion BSD `wc -l` pads count with leading spaces on macOS (e.g. " 3"), which made `[ ' 3' = '3' ]` always false. Verified: dth_sp1_more.test.sh 27/27 PASS on host after fix. --- tests/e2e/dth_sp1_more.test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/dth_sp1_more.test.sh b/tests/e2e/dth_sp1_more.test.sh index 5ca4503..8ed2b15 100644 --- a/tests/e2e/dth_sp1_more.test.sh +++ b/tests/e2e/dth_sp1_more.test.sh @@ -176,7 +176,7 @@ assert "C6_tds_match_token_nonempty" "[ -n '$TDS_MATCH_TOKEN' ]" "tds match toke assert "C6_tds_match_schema_v2" "[ '$TDS_MATCH_SCHEMA' = 'v2' ]" "tds match schema=$TDS_MATCH_SCHEMA" # Verify JWT-like token structure externally (header.payload.signature) -TDS_TOKEN_PARTS="$(echo "$TDS_MATCH_TOKEN" | tr '.' '\n' | wc -l)" +TDS_TOKEN_PARTS="$(echo "$TDS_MATCH_TOKEN" | tr '.' '\n' | wc -l | tr -d ' ')" assert "C6_tds_match_token_3parts" "[ '$TDS_TOKEN_PARTS' = '3' ]" "expected 3-part JWT-like token, got $TDS_TOKEN_PARTS parts" TDS_MISMATCH_BODY="$(curl -s -H "Authorization: Bearer $ADMIN_TOKEN" -H 'Content-Type: application/json' \