Skip to content

Commit 3ce76dd

Browse files
Cover underscore in session-id parsing test
The pattern allows [A-Za-z0-9_-]+; add an underscore-containing id (abc_def-123) to capturesMultipleSessionIds so the underscore branch of the character class is exercised alongside the hyphenated ids.
1 parent 90e9658 commit 3ce76dd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/test/java/testingbot/TestingBotSessionIdParsingTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public void capturesPlainHexSessionId() {
3232
public void capturesMultipleSessionIds() {
3333
List<String> found = new ArrayList<>();
3434
TestingBotReportFactory.collectSessionIDs(
35-
"TestingBotSessionID=aaa-111\nTestingBotSessionID=bbb-222", found);
36-
assertThat(found).containsExactly("aaa-111", "bbb-222");
35+
"TestingBotSessionID=aaa-111\nTestingBotSessionID=bbb-222\nTestingBotSessionID=abc_def-123",
36+
found);
37+
assertThat(found).containsExactly("aaa-111", "bbb-222", "abc_def-123");
3738
}
3839

3940
@Test

0 commit comments

Comments
 (0)