Skip to content

Commit 2534c62

Browse files
committed
Add FunctionalLocation equal test
Note: this test does not cover the fix. Only run all ui test case and then LabelsHiddenModifierUITests.toggleLabelsHidden will hit the recursive loop
1 parent 71d2f5f commit 2534c62

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tests/OpenSwiftUICoreTests/Data/Binding/LocationTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,13 @@ struct LocationTests {
136136
location.set(2, transaction: .init())
137137
#expect(location.wasRead == true)
138138
#expect(location.get() == 4)
139+
140+
let location2 = FunctionalLocation {
141+
value.count
142+
} setValue: { newCount, _ in
143+
value.count = newCount * newCount
144+
}
145+
#expect(location2 != location)
146+
#expect(location == location)
139147
}
140148
}

0 commit comments

Comments
 (0)