Skip to content

Commit f87f3f5

Browse files
committed
Add compatibility tests for IndirectAttribute attribute and resetSource()
1 parent 9839901 commit f87f3f5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Tests/OpenAttributeGraphCompatibilityTests/Attribute/Indirect/IndirectAttributeCompatibilityTests.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,24 @@ struct IndirectAttributeCompatibilityTests {
1212
func basic() {
1313
let source = Attribute(value: 0)
1414
let indirect = IndirectAttribute(source: source)
15+
#expect(indirect.attribute.identifier == indirect.identifier)
1516
#expect(indirect.identifier != source.identifier)
1617
#expect(indirect.source.identifier == source.identifier)
1718
#expect(indirect.dependency == .init(rawValue: 0))
1819
}
20+
21+
@Test
22+
func resetSource() {
23+
let source1 = Attribute(value: 0)
24+
let indirect = IndirectAttribute(source: source1)
25+
#expect(indirect.source.identifier == source1.identifier)
26+
27+
let source2 = Attribute(value: 0)
28+
indirect.source = source2
29+
#expect(indirect.source.identifier == source2.identifier)
30+
31+
indirect.resetSource()
32+
#expect(indirect.source.identifier == source1.identifier)
33+
}
1934
}
2035
#endif

0 commit comments

Comments
 (0)