|
7 | 7 |
|
8 | 8 | final class ObservableStateMacroTests: MacroBaseTestCase {
|
9 | 9 | override func invokeTest() {
|
10 |
| - withMacroTesting { |
| 10 | + withMacroTesting( |
| 11 | + // record: .failed, |
| 12 | + ) { |
11 | 13 | super.invokeTest()
|
12 | 14 | }
|
13 | 15 | }
|
|
35 | 37 | return _count
|
36 | 38 | }
|
37 | 39 | set {
|
38 |
| - _$observationRegistrar.mutate(self, keyPath: \.count, &_count, newValue, _$isIdentityEqual) |
| 40 | + _$observationRegistrar.mutate(self, keyPath: \.count, &_count, newValue, _$isIdentityEqual, shouldNotifyObservers) |
39 | 41 | }
|
40 | 42 | _modify {
|
41 | 43 | let oldValue = _$observationRegistrar.willModify(self, keyPath: \.count, &_count)
|
|
55 | 57 | public mutating func _$willModify() {
|
56 | 58 | _$observationRegistrar._$willModify()
|
57 | 59 | }
|
| 60 | +
|
| 61 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu_>(_ lhs: __macro_local_6MemberfMu_, _ rhs: __macro_local_6MemberfMu_) -> Bool { |
| 62 | + true |
| 63 | + } |
| 64 | +
|
| 65 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu0_: Equatable>(_ lhs: __macro_local_6MemberfMu0_, _ rhs: __macro_local_6MemberfMu0_) -> Bool { |
| 66 | + lhs != rhs |
| 67 | + } |
| 68 | +
|
| 69 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu1_: AnyObject>(_ lhs: __macro_local_6MemberfMu1_, _ rhs: __macro_local_6MemberfMu1_) -> Bool { |
| 70 | + lhs !== rhs |
| 71 | + } |
| 72 | +
|
| 73 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu2_: Equatable & AnyObject>(_ lhs: __macro_local_6MemberfMu2_, _ rhs: __macro_local_6MemberfMu2_) -> Bool { |
| 74 | + lhs != rhs |
| 75 | + } |
58 | 76 | }
|
59 | 77 | """#
|
60 | 78 | }
|
|
81 | 99 | return _count
|
82 | 100 | }
|
83 | 101 | set {
|
84 |
| - _$observationRegistrar.mutate(self, keyPath: \.count, &_count, newValue, _$isIdentityEqual) |
| 102 | + _$observationRegistrar.mutate(self, keyPath: \.count, &_count, newValue, _$isIdentityEqual, shouldNotifyObservers) |
85 | 103 | }
|
86 | 104 | _modify {
|
87 | 105 | let oldValue = _$observationRegistrar.willModify(self, keyPath: \.count, &_count)
|
|
101 | 119 | public mutating func _$willModify() {
|
102 | 120 | _$observationRegistrar._$willModify()
|
103 | 121 | }
|
| 122 | +
|
| 123 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu_>(_ lhs: __macro_local_6MemberfMu_, _ rhs: __macro_local_6MemberfMu_) -> Bool { |
| 124 | + true |
| 125 | + } |
| 126 | +
|
| 127 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu0_: Equatable>(_ lhs: __macro_local_6MemberfMu0_, _ rhs: __macro_local_6MemberfMu0_) -> Bool { |
| 128 | + lhs != rhs |
| 129 | + } |
| 130 | +
|
| 131 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu1_: AnyObject>(_ lhs: __macro_local_6MemberfMu1_, _ rhs: __macro_local_6MemberfMu1_) -> Bool { |
| 132 | + lhs !== rhs |
| 133 | + } |
| 134 | +
|
| 135 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu2_: Equatable & AnyObject>(_ lhs: __macro_local_6MemberfMu2_, _ rhs: __macro_local_6MemberfMu2_) -> Bool { |
| 136 | + lhs != rhs |
| 137 | + } |
104 | 138 | }
|
105 | 139 | """#
|
106 | 140 | }
|
|
127 | 161 | return _count
|
128 | 162 | }
|
129 | 163 | set {
|
130 |
| - _$observationRegistrar.mutate(self, keyPath: \.count, &_count, newValue, _$isIdentityEqual) |
| 164 | + _$observationRegistrar.mutate(self, keyPath: \.count, &_count, newValue, _$isIdentityEqual, shouldNotifyObservers) |
131 | 165 | }
|
132 | 166 | _modify {
|
133 | 167 | let oldValue = _$observationRegistrar.willModify(self, keyPath: \.count, &_count)
|
|
147 | 181 | public mutating func _$willModify() {
|
148 | 182 | _$observationRegistrar._$willModify()
|
149 | 183 | }
|
| 184 | +
|
| 185 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu_>(_ lhs: __macro_local_6MemberfMu_, _ rhs: __macro_local_6MemberfMu_) -> Bool { |
| 186 | + true |
| 187 | + } |
| 188 | +
|
| 189 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu0_: Equatable>(_ lhs: __macro_local_6MemberfMu0_, _ rhs: __macro_local_6MemberfMu0_) -> Bool { |
| 190 | + lhs != rhs |
| 191 | + } |
| 192 | +
|
| 193 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu1_: AnyObject>(_ lhs: __macro_local_6MemberfMu1_, _ rhs: __macro_local_6MemberfMu1_) -> Bool { |
| 194 | + lhs !== rhs |
| 195 | + } |
| 196 | +
|
| 197 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu2_: Equatable & AnyObject>(_ lhs: __macro_local_6MemberfMu2_, _ rhs: __macro_local_6MemberfMu2_) -> Bool { |
| 198 | + lhs != rhs |
| 199 | + } |
150 | 200 | }
|
151 | 201 | """#
|
152 | 202 | }
|
|
170 | 220 | return _count
|
171 | 221 | }
|
172 | 222 | set {
|
173 |
| - _$observationRegistrar.mutate(self, keyPath: \.count, &_count, newValue, _$isIdentityEqual) |
| 223 | + _$observationRegistrar.mutate(self, keyPath: \.count, &_count, newValue, _$isIdentityEqual, shouldNotifyObservers) |
174 | 224 | }
|
175 | 225 | _modify {
|
176 | 226 | let oldValue = _$observationRegistrar.willModify(self, keyPath: \.count, &_count)
|
|
190 | 240 | public mutating func _$willModify() {
|
191 | 241 | _$observationRegistrar._$willModify()
|
192 | 242 | }
|
| 243 | +
|
| 244 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu_>(_ lhs: __macro_local_6MemberfMu_, _ rhs: __macro_local_6MemberfMu_) -> Bool { |
| 245 | + true |
| 246 | + } |
| 247 | +
|
| 248 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu0_: Equatable>(_ lhs: __macro_local_6MemberfMu0_, _ rhs: __macro_local_6MemberfMu0_) -> Bool { |
| 249 | + lhs != rhs |
| 250 | + } |
| 251 | +
|
| 252 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu1_: AnyObject>(_ lhs: __macro_local_6MemberfMu1_, _ rhs: __macro_local_6MemberfMu1_) -> Bool { |
| 253 | + lhs !== rhs |
| 254 | + } |
| 255 | +
|
| 256 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu2_: Equatable & AnyObject>(_ lhs: __macro_local_6MemberfMu2_, _ rhs: __macro_local_6MemberfMu2_) -> Bool { |
| 257 | + lhs != rhs |
| 258 | + } |
193 | 259 | }
|
194 | 260 | """#
|
195 | 261 | }
|
|
218 | 284 | public mutating func _$willModify() {
|
219 | 285 | _$observationRegistrar._$willModify()
|
220 | 286 | }
|
| 287 | +
|
| 288 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu_>(_ lhs: __macro_local_6MemberfMu_, _ rhs: __macro_local_6MemberfMu_) -> Bool { |
| 289 | + true |
| 290 | + } |
| 291 | +
|
| 292 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu0_: Equatable>(_ lhs: __macro_local_6MemberfMu0_, _ rhs: __macro_local_6MemberfMu0_) -> Bool { |
| 293 | + lhs != rhs |
| 294 | + } |
| 295 | +
|
| 296 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu1_: AnyObject>(_ lhs: __macro_local_6MemberfMu1_, _ rhs: __macro_local_6MemberfMu1_) -> Bool { |
| 297 | + lhs !== rhs |
| 298 | + } |
| 299 | +
|
| 300 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu2_: Equatable & AnyObject>(_ lhs: __macro_local_6MemberfMu2_, _ rhs: __macro_local_6MemberfMu2_) -> Bool { |
| 301 | + lhs != rhs |
| 302 | + } |
221 | 303 | }
|
222 | 304 | """
|
223 | 305 | }
|
|
673 | 755 | public mutating func _$willModify() {
|
674 | 756 | _$observationRegistrar._$willModify()
|
675 | 757 | }
|
| 758 | +
|
| 759 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu_>(_ lhs: __macro_local_6MemberfMu_, _ rhs: __macro_local_6MemberfMu_) -> Bool { |
| 760 | + true |
| 761 | + } |
| 762 | +
|
| 763 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu0_: Equatable>(_ lhs: __macro_local_6MemberfMu0_, _ rhs: __macro_local_6MemberfMu0_) -> Bool { |
| 764 | + lhs != rhs |
| 765 | + } |
| 766 | +
|
| 767 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu1_: AnyObject>(_ lhs: __macro_local_6MemberfMu1_, _ rhs: __macro_local_6MemberfMu1_) -> Bool { |
| 768 | + lhs !== rhs |
| 769 | + } |
| 770 | +
|
| 771 | + private nonisolated func shouldNotifyObservers<__macro_local_6MemberfMu2_: Equatable & AnyObject>(_ lhs: __macro_local_6MemberfMu2_, _ rhs: __macro_local_6MemberfMu2_) -> Bool { |
| 772 | + lhs != rhs |
| 773 | + } |
676 | 774 | }
|
677 | 775 | """
|
678 | 776 | }
|
|
0 commit comments