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.
This commit is contained in:
1 parent
6db11ca308
commit
2082df948f
1 file changed
+1
-1
@@ -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' \
|
||||
|
||||
Reference in new issue
Block a user