Skip to content

Commit b501e83

Browse files
Added Comment component test with a number (#90)
1 parent eca0850 commit b501e83

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Tests/SplashTests/Tests/CommentTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ final class CommentTests: SyntaxHighlighterTestCase {
135135
.plainText("{}")
136136
])
137137
}
138+
139+
func testCommentWithNumber() {
140+
let components = highlighter.highlight("// 1")
141+
142+
XCTAssertEqual(components, [
143+
.token("//", .comment),
144+
.whitespace(" "),
145+
.token("1", .comment)
146+
])
147+
}
138148

139149
func testCommentWithNoWhiteSpaceToPunctuation() {
140150
let components = highlighter.highlight("""
@@ -177,6 +187,7 @@ extension CommentTests {
177187
("testMutliLineDocumentationComment", testMutliLineDocumentationComment),
178188
("testCommentStartingWithPunctuation", testCommentStartingWithPunctuation),
179189
("testCommentEndingWithComma", testCommentEndingWithComma),
190+
("testCommentWithNumber", testCommentWithNumber),
180191
("testCommentWithNoWhiteSpaceToPunctuation", testCommentWithNoWhiteSpaceToPunctuation)
181192
]
182193
}

0 commit comments

Comments
 (0)