Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
helje5 committed May 25, 2022
2 parents 6b4c382 + a0553c0 commit b021e6e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
matrix:
image:
- swift:5.3.2-xenial
- swift:5.3.2-bionic
- swift:5.5.0-focal
- swift:5.6.1-bionic
container: ${{ matrix.image }}
steps:
- name: Checkout Repository
Expand Down
1 change: 1 addition & 0 deletions Sources/DocCArchive/Schema_0_1/MetaData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ extension DocCArchive.DocCSchema_0_1 {
case typeProperty = "Type Property"
case `typealias` = "Type Alias"
case `class` = "Class"
case application = "Application"

public var description: String { return "<RoleHeading: \(rawValue)>" }
}
Expand Down
33 changes: 32 additions & 1 deletion Tests/DocCArchiveTests/DocumentDecodingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,40 @@ final class DocumentDecodingTests: XCTestCase {
( "testIssue11FailUnorderedList" , testIssue11FailUnorderedList ),
( "testAllDataJSONInSlothCreator" , testAllDataJSONInSlothCreator ),
( "testIssue12FailAsideWarningStyle" , testIssue12FailAsideWarningStyle ),
( "testTableIssue6" , testTableIssue6 )
( "testTableIssue6" , testTableIssue6 ),
( "testIssue20FailRoleHeadingApp" , testIssue20FailRoleHeadingApp )
]


func testIssue20FailRoleHeadingApp() throws {
let url = Fixtures.baseURL.appendingPathComponent("Issue20Fail.json")
let data = try Data(contentsOf: url)

let document : DocCArchive.Document

print("Decoding:", url.path)
do {
document = try JSONDecoder().decode(DocCArchive.Document.self, from: data)
}
catch {
print("ERROR:", error)
XCTFail("failed to decode: \(error)")
return
}

// v0.2.0 as declared
XCTAssertEqual(document.schemaVersion, .init(major: 0, minor: 2, patch: 0))

XCTAssertEqual(document.primaryContentSections?.count ?? 0, 0,
"Didn't expect sections?")

XCTAssertEqual(document.topicSections?.count, 2,
"Missing topic sections")

XCTAssertEqual(document.metadata.roleHeading, .application,
"Expected application role heading!")
}

func testLinkInlineContentIssue7() throws {
let url = Fixtures.baseURL.appendingPathComponent("LinkInlineContentIssue7.json")
let data = try Data(contentsOf: url)
Expand Down
1 change: 1 addition & 0 deletions Tests/DocCArchiveTests/Fixtures/Issue20Fail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"variants":[{"paths":["\/documentation\/robotnavigation"],"traits":[{"interfaceLanguage":"swift"}]}],"schemaVersion":{"major":0,"minor":2,"patch":0},"sections":[],"identifier":{"url":"doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":""}],"kind":"symbol","metadata":{"roleHeading":"Application","externalID":"RobotNavigation","title":"RobotNavigation","symbolKind":"module","role":"collection","modules":[{"name":"RobotNavigation"}]},"hierarchy":{"paths":[[]]},"topicSections":[{"title":"Classes","identifiers":["doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/AppDelegate","doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/BlePeripheral","doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/NavigationViewController","doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/SceneDelegate","doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/ViewController"]},{"title":"Structures","identifiers":["doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/CBUUIDs"]}],"references":{"doc://com.lennart.RobotNavigation/documentation/RobotNavigation/ViewController":{"role":"symbol","title":"ViewController","fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"ViewController"}],"abstract":[],"identifier":"doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/ViewController","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"ViewController"}],"url":"\/documentation\/robotnavigation\/viewcontroller"},"doc://com.lennart.RobotNavigation/documentation/RobotNavigation/SceneDelegate":{"role":"symbol","title":"SceneDelegate","fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"SceneDelegate"}],"abstract":[],"identifier":"doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/SceneDelegate","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SceneDelegate"}],"url":"\/documentation\/robotnavigation\/scenedelegate"},"doc://com.lennart.RobotNavigation/documentation/RobotNavigation/NavigationViewController":{"role":"symbol","title":"NavigationViewController","fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"NavigationViewController"}],"abstract":[{"type":"text","text":"Description"}],"identifier":"doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/NavigationViewController","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"NavigationViewController"}],"url":"\/documentation\/robotnavigation\/navigationviewcontroller"},"doc://com.lennart.RobotNavigation/documentation/RobotNavigation/AppDelegate":{"role":"symbol","title":"AppDelegate","fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"AppDelegate"}],"abstract":[],"identifier":"doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/AppDelegate","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"AppDelegate"}],"url":"\/documentation\/robotnavigation\/appdelegate"},"doc://com.lennart.RobotNavigation/documentation/RobotNavigation/CBUUIDs":{"role":"symbol","title":"CBUUIDs","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"CBUUIDs"}],"abstract":[],"identifier":"doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/CBUUIDs","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"CBUUIDs"}],"url":"\/documentation\/robotnavigation\/cbuuids"},"doc://com.lennart.RobotNavigation/documentation/RobotNavigation":{"role":"collection","title":"RobotNavigation","abstract":[],"identifier":"doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation","kind":"symbol","type":"topic","url":"\/documentation\/robotnavigation"},"doc://com.lennart.RobotNavigation/documentation/RobotNavigation/BlePeripheral":{"role":"symbol","title":"BlePeripheral","fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"BlePeripheral"}],"abstract":[],"identifier":"doc:\/\/com.lennart.RobotNavigation\/documentation\/RobotNavigation\/BlePeripheral","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"BlePeripheral"}],"url":"\/documentation\/robotnavigation\/bleperipheral"}}}

0 comments on commit b021e6e

Please sign in to comment.