Skip to content

Commit

Permalink
Merge branch 'main' into automation/update-contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored May 1, 2024
2 parents 548c05b + 7c4eb71 commit a835ead
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class DistributedMap extends MapBase implements INextable {
errors.push('label must be 40 characters or less');
}

let labelRegex = new RegExp('[\s\?\*\<\>\{\}\\[\\]\:\;\,\\\|\^\~\$\#\%\&\`\"]|[\u0000-\u001f]|[\u007f-\u009f]', 'gi');
let labelRegex = /[\s\?\*\<\>\{\}\\[\]\:\;\,\|\^\~\$\#\%\&\`\"]|[\u0000-\u001f]|[\u007f-\u009f]/gi;
if (labelRegex.test(this.label)) {
errors.push('label cannot contain any whitespace or special characters');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,19 @@ describe('Distributed Map State', () => {

expect(() => app.synth()).toThrow(/label cannot contain any whitespace or special characters/);
});

test('does not fail in synthesis if label has `s`', () => {
const app = createAppWithMap((stack) => {
const map = new stepfunctions.DistributedMap(stack, 'Map State', {
label: 's',
itemsPath: stepfunctions.JsonPath.stringAt('$.inputForMap'),
});

return map;
});

app.synth();
});
});

function render(sm: stepfunctions.IChainable) {
Expand All @@ -777,4 +790,4 @@ function createAppWithMap(mapFactory: (stack: cdk.Stack) => stepfunctions.Distri
const map = mapFactory(stack);
new stepfunctions.StateGraph(map, 'Test Graph');
return app;
}
}

0 comments on commit a835ead

Please sign in to comment.