-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
177 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
|
||
import XCTest | ||
import GrainDescriptor | ||
|
||
// MARK: - Variables | ||
|
||
let param_a = GrainMember("param_a") { | ||
"111" | ||
} | ||
|
||
let simulatorTarget = GrainMember("Simulator Target Bundle") { | ||
"app.muukii.myapp" | ||
} | ||
|
||
final class APNsTests: XCTestCase { | ||
|
||
func test_aggregation() { | ||
|
||
compare( | ||
GrainObject { | ||
GrainMember("a") { | ||
["a", "b"] | ||
} | ||
GrainMember("a") { | ||
["a", "b", "c"] | ||
} | ||
}, | ||
""" | ||
{ | ||
"a" : [ | ||
"a", | ||
"b", | ||
"c" | ||
] | ||
} | ||
""" | ||
) | ||
|
||
} | ||
|
||
func test_spread() { | ||
|
||
let object1 = GrainObject { | ||
GrainMember("a") { 1 } | ||
} | ||
|
||
let object2 = GrainObject { | ||
GrainMember("a") { 1 } | ||
GrainMember("b") { 1 } | ||
} | ||
|
||
compare( | ||
GrainObject { | ||
object1.spread | ||
object2.spread | ||
}, | ||
""" | ||
{ | ||
"a" : 1, | ||
"b" : 1 | ||
} | ||
""" | ||
) | ||
|
||
} | ||
|
||
} | ||
// | ||
//struct APNS<Content: GrainView>: GrainView { | ||
// | ||
// let content: Content | ||
// | ||
// init(@GrainBuilder _ content: () -> Content) { | ||
// self.content = content() | ||
// } | ||
// | ||
// var body: some GrainView { | ||
// GrainObject { | ||
// content | ||
// } | ||
// } | ||
// | ||
//} | ||
|
||
struct APS: GrainView { | ||
|
||
let alert: String | ||
|
||
var body: some GrainView { | ||
|
||
GrainObject { | ||
// GrainMember("alert") { | ||
// alert | ||
// } | ||
} | ||
|
||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters