Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// swift-tools-version:5.0
// swift-tools-version:6.0

import PackageDescription

let package = Package(
name: "Then",
platforms: [
.macOS(.v10_10), .iOS(.v9), .tvOS(.v9), .watchOS(.v2),
.macOS(.v10_13), .iOS(.v12), .tvOS(.v12), .watchOS(.v4),
],
products: [
.library(name: "Then", targets: ["Then"]),
Expand Down
16 changes: 8 additions & 8 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let project = Project(
headers: .headers(public: "Sources/Then/**/*.h"),
settings: .settings(
base: [
"SWIFT_VERSION": "5.0",
"SWIFT_VERSION": "6.0",
"PRODUCT_NAME": "Then",
"PRODUCT_MODULE_NAME": "Then",
],
Expand All @@ -43,7 +43,7 @@ let project = Project(
],
settings: .settings(
base: [
"SWIFT_VERSION": "5.0",
"SWIFT_VERSION": "6.0",
],
),
),
Expand All @@ -58,7 +58,7 @@ let project = Project(
headers: .headers(public: "Sources/Then/**/*.h"),
settings: .settings(
base: [
"SWIFT_VERSION": "5.0",
"SWIFT_VERSION": "6.0",
"PRODUCT_NAME": "Then",
"PRODUCT_MODULE_NAME": "Then",
],
Expand All @@ -77,7 +77,7 @@ let project = Project(
],
settings: .settings(
base: [
"SWIFT_VERSION": "5.0",
"SWIFT_VERSION": "6.0",
],
),
),
Expand All @@ -92,7 +92,7 @@ let project = Project(
headers: .headers(public: "Sources/Then/**/*.h"),
settings: .settings(
base: [
"SWIFT_VERSION": "5.0",
"SWIFT_VERSION": "6.0",
"PRODUCT_NAME": "Then",
"PRODUCT_MODULE_NAME": "Then",
],
Expand All @@ -111,7 +111,7 @@ let project = Project(
],
settings: .settings(
base: [
"SWIFT_VERSION": "5.0",
"SWIFT_VERSION": "6.0",
],
),
),
Expand All @@ -126,7 +126,7 @@ let project = Project(
headers: .headers(public: "Sources/Then/**/*.h"),
settings: .settings(
base: [
"SWIFT_VERSION": "5.0",
"SWIFT_VERSION": "6.0",
"PRODUCT_NAME": "Then",
"PRODUCT_MODULE_NAME": "Then",
],
Expand All @@ -145,7 +145,7 @@ let project = Project(
],
settings: .settings(
base: [
"SWIFT_VERSION": "5.0",
"SWIFT_VERSION": "6.0",
],
),
),
Expand Down
34 changes: 34 additions & 0 deletions Tests/ThenTests/ThenTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,38 @@ class ThenTests: XCTestCase {
},
)
}

@MainActor
func testThen_MainActorIsolated() {
@MainActor class MyView: NSObject {
var title: String = ""
}
let view = MyView().then {
$0.title = "hello"
}
XCTAssertEqual(view.title, "hello")
}

@MainActor
func testWith_MainActorIsolated() {
@MainActor struct Config: Then {
var value: Int = 0
}
let config = Config().with {
$0.value = 42
}
XCTAssertEqual(config.value, 42)
}

@MainActor
func testDo_MainActorIsolated() {
@MainActor class Store: NSObject {
var count: Int = 0
}
let store = Store()
store.do {
$0.count = 10
}
XCTAssertEqual(store.count, 10)
}
}
Loading