Add test case for directives inside triple backticks

This commit is contained in:
Steven T. Cramer 2025-06-16 14:12:05 +07:00
parent 5efd95a8c5
commit f10ab35312

View file

@ -64,4 +64,18 @@ suite("DirectiveStreamingParser", () => {
} as ToolDirective,
])
})
test("should not parse directives inside triple backticks as directives", () => {
const input =
"Some text with\n```\n<log_message>\n<message>This is a warning message</message>\n<level>warn</level>\n</log_message>\n```\nMore text"
const result = DirectiveStreamingParser.parse(input)
expect(result).toEqual([
{
type: "text",
content:
"Some text with\n```\n<log_message>\n<message>This is a warning message</message>\n<level>warn</level>\n</log_message>\n```\nMore text",
partial: true,
} as TextDirective,
])
})
})