Skip to content

Commit

Permalink
Fix iOS flaky test case (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Sep 24, 2024
1 parent 63c8cba commit 962836a
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import OpenSwiftUI
struct ColorResolvedTests {
init() {
#if !OPENSWIFTUI_COMPATIBILITY_TEST
Color.Resolved._alignWithSwiftUIImplementation = false
#endif
}

Expand Down Expand Up @@ -52,11 +51,15 @@ struct ColorResolvedTests {
let resolved = Color.Resolved(colorSpace: colorSpace, red: red, green: green, blue: blue, opacity: opacity)
#expect(resolved.description == swiftUIExpected)
#else
let resolved = Color.Resolved(colorSpace: colorSpace, red: red, green: green, blue: blue, opacity: opacity)
#expect(resolved.description == openSwiftUIExpected)
Color.Resolved._alignWithSwiftUIImplementation = true
let resolved2 = Color.Resolved(colorSpace: colorSpace, red: red, green: green, blue: blue, opacity: opacity)
#expect(resolved2.description == swiftUIExpected)
Update.locked {
Color.Resolved._alignWithSwiftUIImplementation = false
let resolved = Color.Resolved(colorSpace: colorSpace, red: red, green: green, blue: blue, opacity: opacity)
#expect(resolved.description == openSwiftUIExpected)

Color.Resolved._alignWithSwiftUIImplementation = true
let resolved2 = Color.Resolved(colorSpace: colorSpace, red: red, green: green, blue: blue, opacity: opacity)
#expect(resolved2.description == swiftUIExpected)
}
#endif
}
}

0 comments on commit 962836a

Please sign in to comment.