Skip to content

Commit b0b5213

Browse files
committed
Add multi-code-unit characters to length validation tests
Server implementations that naively use code units instead of code points to evaluate length constraints will give incorrect results. This adds parameters to the existing string length tests that use multi-code-unit characters to generate strings that will meet the constraints if code units are counted, but properly fail the constraints if code points are counted. Fixes #1090
1 parent e7a9528 commit b0b5213

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

smithy-aws-protocol-tests/model/restJson1/validation/malformed-length.smithy

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ apply MalformedLength @httpMalformedRequestTests([
9292
}
9393
},
9494
testParameters: {
95-
value: ["a", "abcdefghijklmnopqrstuvwxyz"],
96-
inputLength: ["1", "26"]
95+
value: ["a", "abcdefghijklmnopqrstuvwxyz", "👍"],
96+
inputLength: ["1", "26", "1"]
9797
}
9898
},
9999
{
@@ -409,8 +409,8 @@ apply MalformedLengthOverride @httpMalformedRequestTests([
409409
}
410410
},
411411
testParameters: {
412-
value: ["abc", "abcdefg"],
413-
inputLength: ["3", "7"]
412+
value: ["abc", "abcdefg", "👍👍👍"],
413+
inputLength: ["3", "7", "3"]
414414
}
415415
},
416416
{

0 commit comments

Comments
 (0)