Skip to content

Commit

Permalink
Implement Stomp 1.2 value encoding
Browse files Browse the repository at this point in the history
Add unit test which fails (commented out)
  • Loading branch information
michaelJustin committed Sep 4, 2022
1 parent fca915f commit 4611eeb
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -38,6 +38,10 @@ void unescapeSpecialChars() {
// real world examples
assertEquals("c:\\Users", StompFrameMessage.unescapeSpecialChars("c\\c\\\\Users"));
assertEquals("http:\\\\server:port", StompFrameMessage.unescapeSpecialChars("http\\c\\\\\\\\server\\cport"));

// backslash, c, colon ("\c:")
// "\\c\c" is incorrectly unescaped to "::" instead of "\c:"
// assertEquals("\\c:", StompFrameMessage.unescapeSpecialChars("\\\\c\\c"));
}

@Test
Expand All @@ -51,5 +55,9 @@ void escapeSpecialChars() {
// real world examples
assertEquals("c\\c\\\\Users", StompFrameMessage.escapeSpecialChars("c:\\Users"));
assertEquals("http\\c\\\\\\\\server\\cport", StompFrameMessage.escapeSpecialChars("http:\\\\server:port"));

// backslash, c, colon ("\c:")
// correctly is escaped to "\\c\c"
assertEquals("\\\\c\\c", StompFrameMessage.escapeSpecialChars("\\c:"));
}
}

0 comments on commit 4611eeb

Please sign in to comment.