@@ -4,21 +4,21 @@ import { extractFromCodeTitle } from "./_codeBlock.ts";
44
55/**
66 * Tests for code block title parsing functionality
7- *
7+ *
88 * These tests verify the parsing of code block titles in various formats:
99 * - Valid formats: code:filename.ext(param), code:filename(param), code:filename.ext
1010 * - Invalid formats: trailing dots, incorrect prefixes, non-code blocks
1111 */
1212Deno . test ( "extractFromCodeTitle()" , async ( t ) => {
1313 await t . step ( "accurate titles" , async ( st ) => {
1414 const titles = [
15- "code:foo.extA(extB)" , // Basic format: no spaces
16- " code:foo.extA(extB)" , // Leading space before code:
17- " code: foo.extA (extB)" , // Spaces around components
18- " code: foo (extB) " , // Extension omitted, has parameter
19- " code: foo.extA " , // Extension only, no parameter
20- " code: foo " , // Basic name only
21- " code: .foo " , // Leading dot in name
15+ "code:foo.extA(extB)" , // Basic format: no spaces
16+ " code:foo.extA(extB)" , // Leading space before code:
17+ " code: foo.extA (extB)" , // Spaces around components
18+ " code: foo (extB) " , // Extension omitted, has parameter
19+ " code: foo.extA " , // Extension only, no parameter
20+ " code: foo " , // Basic name only
21+ " code: .foo " , // Leading dot in name
2222 ] ;
2323 for ( const title of titles ) {
2424 await st . step ( `"${ title } "` , async ( sst ) => {
@@ -30,9 +30,9 @@ Deno.test("extractFromCodeTitle()", async (t) => {
3030 await t . step ( "inaccurate titles" , async ( st ) => {
3131 const nonTitles = [
3232 " code: foo. " , // Invalid: Trailing dot without extension is not a valid code block format
33- // Returning `null` is expected as this format is invalid
34- "any:code: foo " , // Invalid: Must start with exactly "code:" prefix
35- " I'm not code block " , // Invalid: Not a code block format at all
33+ // Returning `null` is expected as this format is invalid
34+ "any:code: foo " , // Invalid: Must start with exactly "code:" prefix
35+ " I'm not code block " , // Invalid: Not a code block format at all
3636 ] ;
3737 for ( const title of nonTitles ) {
3838 await st . step ( `"${ title } "` , async ( ) => {
0 commit comments