-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fca6dc
commit 7b3f2e0
Showing
3 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { assertEquals } from "../../deps/std/testing.ts"; | ||
import { T } from "../tokenize/mod.ts"; | ||
import { | ||
cleanComment, | ||
makeFileEndEventContext, | ||
makeFileStartEventContext, | ||
makeInlineCommentEventContext, | ||
makeLoadEventContext, | ||
makeMultilineCommentEventContext, | ||
makeSetPropertyEventContext, | ||
makeStructCloseEventContext, | ||
makeStructOpenEventContext, | ||
} from "./utils.ts"; | ||
|
||
Deno.test("cleans inlined comments to extract text content", () => { | ||
const expectation = ["example"]; | ||
const reality = cleanComment(T.comment("; example", 1, 1)); | ||
assertEquals(expectation, reality); | ||
}); | ||
|
||
Deno.test("cleans multi-inlined comments to extract text content", () => { | ||
const expectation = ["example"]; | ||
const reality = cleanComment(T.multiline_comment("/* example */", 1, 1)); | ||
assertEquals(expectation, reality); | ||
}); | ||
|
||
Deno.test("cleans multi-inlined comments to extract text content (omits whitespace on edges)", () => { | ||
const expectation = ["example"]; | ||
const reality = cleanComment(T.multiline_comment( | ||
`/* | ||
example | ||
*/`, | ||
1, | ||
1, | ||
)); | ||
assertEquals(expectation, reality); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7b3f2e0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to deploy: