File tree Expand file tree Collapse file tree 4 files changed +55
-1
lines changed
Expand file tree Collapse file tree 4 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ public struct SectionMap<Site: Website> {
2828
2929extension SectionMap : Sequence {
3030 public func makeIterator( ) -> AnyIterator < Section < Site > > {
31- AnyIterator ( sections. values. makeIterator ( ) )
31+ var ids = self . ids. makeIterator ( )
32+
33+ return AnyIterator {
34+ guard let nextID = ids. next ( ) else { return nil }
35+ return self [ nextID]
36+ }
3237 }
3338}
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ internal extension Linux {
3131#if canImport(ObjectiveC)
3232internal final class LinuxVerificationTests : XCTestCase {
3333 func testAllTestsRunOnLinux( ) {
34+ var totalLinuxTestCount = 0
35+
3436 for testCase in allTests ( ) {
3537 let type = testCase. testCaseClass
3638
@@ -49,7 +51,19 @@ internal final class LinuxVerificationTests: XCTestCase {
4951 """ )
5052 }
5153 }
54+
55+ totalLinuxTestCount += linuxTestNames. count
5256 }
57+
58+ XCTAssertEqual (
59+ XCTestSuite . default. testCaseCount - 1 ,
60+ totalLinuxTestCount,
61+ """
62+ Linux and Apple Platforms test counts are not equal.
63+ Perhaps you added a new test case class?
64+ If so, you need to add it in XCTestManifests.swift.
65+ """
66+ )
5367 }
5468}
5569#endif
Original file line number Diff line number Diff line change @@ -15,9 +15,11 @@ public func allTests() -> [Linux.TestCase] {
1515 Linux . makeTestCase ( using: FileIOTests . allTests) ,
1616 Linux . makeTestCase ( using: HTMLGenerationTests . allTests) ,
1717 Linux . makeTestCase ( using: MarkdownTests . allTests) ,
18+ Linux . makeTestCase ( using: PathTests . allTests) ,
1819 Linux . makeTestCase ( using: PlotComponentTests . allTests) ,
1920 Linux . makeTestCase ( using: PluginTests . allTests) ,
2021 Linux . makeTestCase ( using: PodcastFeedGenerationTests . allTests) ,
22+ Linux . makeTestCase ( using: PublishingContextTests . allTests) ,
2123 Linux . makeTestCase ( using: RSSFeedGenerationTests . allTests) ,
2224 Linux . makeTestCase ( using: SiteMapGenerationTests . allTests) ,
2325 Linux . makeTestCase ( using: WebsiteTests . allTests)
Original file line number Diff line number Diff line change 1+ /**
2+ * Publish
3+ * Copyright (c) John Sundell 2020
4+ * MIT license, see LICENSE file for details
5+ */
6+
7+ import XCTest
8+ import Publish
9+
10+ final class PublishingContextTests : PublishTestCase {
11+ func testSectionIterationOrder( ) throws {
12+ let expectedOrder = WebsiteStub . SectionID. allCases
13+ var actualOrder = [ WebsiteStub . SectionID] ( )
14+
15+ try publishWebsite ( using: [
16+ . step( named: " Step " ) { context in
17+ context. sections. forEach { section in
18+ actualOrder. append ( section. id)
19+ }
20+ }
21+ ] )
22+
23+ XCTAssertEqual ( expectedOrder, actualOrder)
24+ }
25+ }
26+
27+ extension PublishingContextTests {
28+ static var allTests : Linux . TestList < PublishingContextTests > {
29+ [
30+ ( " testSectionIterationOrder " , testSectionIterationOrder)
31+ ]
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments