Add support for Mac Catalyst (#287)

This commit is contained in:
Guille Gonzalez
2023-12-31 17:11:36 +01:00
committed by GitHub
parent 5be879a636
commit ae799d015a
7 changed files with 27 additions and 1 deletions

View File

@@ -3,6 +3,11 @@ test-macos:
-scheme MarkdownUI \
-destination platform="macOS"
test-macos-maccatalyst:
xcodebuild test \
-scheme MarkdownUI \
-destination platform="macOS,variant=Mac Catalyst"
test-ios:
xcodebuild test \
-scheme MarkdownUI \
@@ -18,7 +23,7 @@ test-watchos:
-scheme MarkdownUI \
-destination platform="watchOS Simulator,name=Apple Watch SE (40mm) (2nd generation)"
test: test-macos test-ios test-tvos test-watchos
test: test-macos test-macos-maccatalyst test-ios test-tvos test-watchos
format:
swift format --in-place --recursive .

View File

@@ -8,6 +8,7 @@ let package = Package(
.macOS(.v12),
.iOS(.v15),
.tvOS(.v15),
.macCatalyst(.v15),
.watchOS(.v8),
],
products: [

View File

@@ -8,6 +8,10 @@
final class MarkdownImageTests: XCTestCase {
private let layout = SwiftUISnapshotLayout.device(config: .iPhone8)
override func setUpWithError() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Skipping on Mac Catalyst")
}
func testFailingImage() {
let view = Markdown {
#"""

View File

@@ -8,6 +8,10 @@
final class MarkdownListTests: XCTestCase {
private let layout = SwiftUISnapshotLayout.device(config: .iPhone8)
override func setUpWithError() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Skipping on Mac Catalyst")
}
func testTaskList() {
let view = Markdown {
#"""

View File

@@ -8,6 +8,10 @@
final class MarkdownTests: XCTestCase {
private let layout = SwiftUISnapshotLayout.device(config: .iPhone8)
override func setUpWithError() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Skipping on Mac Catalyst")
}
func testBlockquote() {
let view = Markdown {
#"""

View File

@@ -8,6 +8,10 @@
final class ThemeDocCTests: XCTestCase {
private let layout = SwiftUISnapshotLayout.device(config: .iPhone8)
override func setUpWithError() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Skipping on Mac Catalyst")
}
func testInlines() {
let view = ThemePreview(theme: .docC) {
#"""

View File

@@ -9,6 +9,10 @@
private let layout = SwiftUISnapshotLayout.device(config: .iPhone8)
private let perceptualPrecision: Float = 0.97
override func setUpWithError() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Skipping on Mac Catalyst")
}
func testInlines() {
let view = ThemePreview(theme: .gitHub) {
#"""