Skip to content

Commit 5278fce

Browse files
authored
Merge pull request #1 from JohnSundell/linux-ci
Linux: Include all test cases
2 parents ef49ee8 + 1f3c2fb commit 5278fce

12 files changed

Lines changed: 158 additions & 1 deletion

Tests/InkTests/CodeTests.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,15 @@ final class CodeTests: XCTestCase {
6262
""")
6363
}
6464
}
65+
66+
extension CodeTests {
67+
static var allTests: [(String, TestClosure<CodeTests>)] {
68+
return [
69+
("testInlineCode", testInlineCode),
70+
("testCodeBlockWithJustBackticks", testCodeBlockWithJustBackticks),
71+
("testCodeBlockWithBackticksAndLabel", testCodeBlockWithBackticksAndLabel),
72+
("testEncodingSpecialCharactersWithinCodeBlock", testEncodingSpecialCharactersWithinCodeBlock),
73+
("testIgnoringFormattingWithinCodeBlock", testIgnoringFormattingWithinCodeBlock)
74+
]
75+
}
76+
}

Tests/InkTests/HTMLTests.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,20 @@ final class HTMLTests: XCTestCase {
9494
XCTAssertEqual(html, "<p>Hello</p><br/><p>World</p>")
9595
}
9696
}
97+
98+
extension HTMLTests {
99+
static var allTests: [(String, TestClosure<HTMLTests>)] {
100+
return [
101+
("testTopLevelHTML", testTopLevelHTML),
102+
("testNestedTopLevelHTML", testNestedTopLevelHTML),
103+
("testTopLevelHTMLWithPreviousNewline", testTopLevelHTMLWithPreviousNewline),
104+
("testIgnoringFormattingWithinTopLevelHTML", testIgnoringFormattingWithinTopLevelHTML),
105+
("testIgnoringTextFormattingWithinInlineHTML", testIgnoringTextFormattingWithinInlineHTML),
106+
("testIgnoringListsWithinInlineHTML", testIgnoringListsWithinInlineHTML),
107+
("testInlineParagraphTagEndingCurrentParagraph", testInlineParagraphTagEndingCurrentParagraph),
108+
("testTopLevelSelfClosingHTMLElement", testTopLevelSelfClosingHTMLElement),
109+
("testInlineSelfClosingHTMLElement", testInlineSelfClosingHTMLElement),
110+
("testTopLevelHTMLLineBreak", testTopLevelHTMLLineBreak)
111+
]
112+
}
113+
}

Tests/InkTests/HeadingTests.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,16 @@ final class HeadingTests: XCTestCase {
4747
XCTAssertEqual(html, "<p>\(markdown)</p>")
4848
}
4949
}
50+
51+
extension HeadingTests {
52+
static var allTests: [(String, TestClosure<HeadingTests>)] {
53+
return [
54+
("testHeading", testHeading),
55+
("testHeadingsSeparatedBySingleNewline", testHeadingsSeparatedBySingleNewline),
56+
("testHeadingsWithLeadingNumbers", testHeadingsWithLeadingNumbers),
57+
("testHeadingWithPreviousWhitespace", testHeadingWithPreviousWhitespace),
58+
("testHeadingWithPreviousNewlineAndWhitespace", testHeadingWithPreviousNewlineAndWhitespace),
59+
("testInvalidHeaderLevel", testInvalidHeaderLevel)
60+
]
61+
}
62+
}

Tests/InkTests/HorizontalLineTests.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,13 @@ final class HorizontalLineTests: XCTestCase {
3737
XCTAssertEqual(html, "<p>Hello</p><hr/><p>World</p>")
3838
}
3939
}
40+
41+
extension HorizontalLineTests {
42+
static var allTests: [(String, TestClosure<HorizontalLineTests>)] {
43+
return [
44+
("testHorizonalLineWithDashes", testHorizonalLineWithDashes),
45+
("testHorizontalLineWithDashesAtTheStartOfString", testHorizontalLineWithDashesAtTheStartOfString),
46+
("testHorizontalLineWithAsterisks", testHorizontalLineWithAsterisks)
47+
]
48+
}
49+
}

Tests/InkTests/ImageTests.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,15 @@ final class ImageTests: XCTestCase {
4141
XCTAssertEqual(html, #"<p>Text <img src="url"/> text</p>"#)
4242
}
4343
}
44+
45+
extension ImageTests {
46+
static var allTests: [(String, TestClosure<ImageTests>)] {
47+
return [
48+
("testImageWithURL", testImageWithURL),
49+
("testImageWithReference", testImageWithReference),
50+
("testImageWithURLAndAltText", testImageWithURLAndAltText),
51+
("testImageWithReferenceAndAltText", testImageWithReferenceAndAltText),
52+
("testImageWithinParagraph", testImageWithinParagraph)
53+
]
54+
}
55+
}

Tests/InkTests/LinkTests.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,16 @@ final class LinkTests: XCTestCase {
4848
XCTAssertEqual(html, "<p><a href=\"/he_llo\">He_llo</a></p>")
4949
}
5050
}
51+
52+
extension LinkTests {
53+
static var allTests: [(String, TestClosure<LinkTests>)] {
54+
return [
55+
("testLinkWithURL", testLinkWithURL),
56+
("testLinkWithReference", testLinkWithReference),
57+
("testNumericLinkWithReference", testNumericLinkWithReference),
58+
("testBoldLinkWithInternalMarkers", testBoldLinkWithInternalMarkers),
59+
("testBoldLinkWithExternalMarkers", testBoldLinkWithExternalMarkers),
60+
("testLinkWithUnderscores", testLinkWithUnderscores)
61+
]
62+
}
63+
}

Tests/InkTests/ListTests.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,17 @@ final class ListTests: XCTestCase {
9595
XCTAssertEqual(html, "<ul><li>One -Two</li><li>Three</li></ul>")
9696
}
9797
}
98+
99+
extension ListTests {
100+
static var allTests: [(String, TestClosure<ListTests>)] {
101+
return [
102+
("testOrderedList", testOrderedList),
103+
("testOrderedListWithoutIncrementedNumbers", testOrderedListWithoutIncrementedNumbers),
104+
("testOrderedListWithInvalidNumbers", testOrderedListWithInvalidNumbers),
105+
("testUnorderedList", testUnorderedList),
106+
("testUnorderedListWithMultiLineItem", testUnorderedListWithMultiLineItem),
107+
("testUnorderedListWithNestedList", testUnorderedListWithNestedList),
108+
("testUnorderedListWithInvalidMarker", testUnorderedListWithInvalidMarker)
109+
]
110+
}
111+
}

Tests/InkTests/MetadataTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,14 @@ final class MetadataTests: XCTestCase {
6767
XCTAssertEqual(markdown.html, "<h1>Title</h1>")
6868
}
6969
}
70+
71+
extension MetadataTests {
72+
static var allTests: [(String, TestClosure<MetadataTests>)] {
73+
return [
74+
("testParsingMetadata", testParsingMetadata),
75+
("testDiscardingEmptyMetadataValues", testDiscardingEmptyMetadataValues),
76+
("testMergingOrphanMetadataValueIntoPreviousOne", testMergingOrphanMetadataValueIntoPreviousOne),
77+
("testMissingMetadata", testMissingMetadata)
78+
]
79+
}
80+
}

Tests/InkTests/ModifierTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,14 @@ final class ModifierTests: XCTestCase {
7777
XCTAssertEqual(html, "<p>Code is cool:</p><pre><code>Code</code></pre>")
7878
}
7979
}
80+
81+
extension ModifierTests {
82+
static var allTests: [(String, TestClosure<ModifierTests>)] {
83+
return [
84+
("testModifierInput", testModifierInput),
85+
("testInitializingParserWithModifiers", testInitializingParserWithModifiers),
86+
("testAddingModifiers", testAddingModifiers),
87+
("testMultipleModifiersForSameTarget", testMultipleModifiersForSameTarget)
88+
]
89+
}
90+
}

Tests/InkTests/TestClosure.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Ink
3+
* Copyright (c) John Sundell 2019
4+
* MIT license, see LICENSE file for details
5+
*/
6+
7+
import XCTest
8+
9+
typealias TestClosure<T: XCTestCase> = (T) -> () throws -> Void

0 commit comments

Comments
 (0)