mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-29 19:01:44 +00:00
test: align code region fence slices
This commit is contained in:
@@ -24,17 +24,17 @@ describe("shared/text/code-regions", () => {
|
||||
text: ["before `inline` after", "```ts", "const a = `inside fence`;", "```", "tail"].join(
|
||||
"\n",
|
||||
),
|
||||
expectedSlices: ["`inline`", "```ts\nconst a = `inside fence`;\n```\n"],
|
||||
expectedSlices: ["`inline`", "```ts\nconst a = `inside fence`;\n```"],
|
||||
},
|
||||
{
|
||||
name: "accepts alternate fence markers and unterminated trailing fences",
|
||||
text: "~~~js\nconsole.log(1)\n~~~\nplain\n```\nunterminated",
|
||||
expectedSlices: ["~~~js\nconsole.log(1)\n~~~\n", "```\nunterminated"],
|
||||
expectedSlices: ["~~~js\nconsole.log(1)\n~~~", "```\nunterminated"],
|
||||
},
|
||||
{
|
||||
name: "keeps adjacent inline code outside fenced regions",
|
||||
text: ["```ts", "const a = 1;", "```", "after `inline` tail"].join("\n"),
|
||||
expectedSlices: ["```ts\nconst a = 1;\n```\n", "`inline`"],
|
||||
expectedSlices: ["```ts\nconst a = 1;\n```", "`inline`"],
|
||||
},
|
||||
] as const)("$name", ({ text, expectedSlices }) => {
|
||||
expectCodeRegionSlices(text, expectedSlices);
|
||||
|
||||
Reference in New Issue
Block a user