Skip to content

Commit

Permalink
Truncate string test value to maxLength in Darwin tests (#12844)
Browse files Browse the repository at this point in the history
  • Loading branch information
Morozov-5F authored and pull[bot] committed Oct 30, 2023
1 parent 4ced2dc commit 349bd77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIP/templates/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ function asExpectedEndpointForCluster(clusterName)
function asTestValue()
{
if (StringHelper.isOctetString(this.type)) {
return '[@"Test" dataUsingEncoding:NSUTF8StringEncoding]';
return `[@"${"Test".substring(0, this.maxLength)}" dataUsingEncoding:NSUTF8StringEncoding]`;
} else if (StringHelper.isCharString(this.type)) {
return '@"Test"';
return `@"${"Test".substring(0, this.maxLength)}"`;
} else if (this.isArray) {
return '[NSArray array]';
} else {
Expand Down

0 comments on commit 349bd77

Please sign in to comment.