Skip to content

Commit

Permalink
fix(parser): correct newline escaping in test cases
Browse files Browse the repository at this point in the history
Update test cases in `CodeUtilTest.kt` to use proper newline characters (`\n`) instead of escaped versions (`\\n`) for markdown and HTTP request content parsing.
  • Loading branch information
phodal committed Dec 8, 2024
1 parent de1586b commit b0cc99a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/test/kotlin/cc/unitmesh/devti/parser/CodeUtilTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ class CodeUtilTest {

@Test
fun should_handle_pure_markdown_content() {
val content = "```markdown\\nGET /wp/v2/posts\\n```"
val content = "```markdown\nGET /wp/v2/posts\n```"
val code = Code.parse(content)
assertEquals(code.text, "GET /wp/v2/posts")
}

@Test
fun should_handle_http_request() {
val content = "```http request\\nGET /wp/v2/posts\\n```"
val content = "```http request\nGET /wp/v2/posts\n```"
val code = Code.parse(content)
assertEquals(code.text, "GET /wp/v2/posts")
}
Expand Down

0 comments on commit b0cc99a

Please sign in to comment.