What area needs maintenance?
@_MockedProperty macro test coverage in Tests/MockingMacrosTests/Macros/MockedPropertyMacro/.
Why is this improvement needed?
When subscript support was added in PR #148, @_MockedSubscript gained actor expansion tests (MockedSubscript_ActorTests.swift) verifying nonisolated modifiers are generated correctly when isMockAnActor: true, and expansion error tests (MockedSubscriptMacro_ExpansionErrorTests.swift) verifying the macro emits a diagnostic when applied to a non-subscript declaration. @_MockedProperty has neither. The existing assertMockedProperty helper also hard-codes isMockAnActor: false, so actor scenarios cannot be tested at all.
Proposed solution
- Add an
isMockAnActor: Bool = false parameter to assertMockedProperty in Tests/MockingMacrosTests/Macros/MockedPropertyMacro/TestHelpers/AssertMockedProperty.swift
- Add
Tests/MockingMacrosTests/Macros/MockedPropertyMacro/MockedProperty_ActorTests.swift testing read-only and read-write property expansion in actor mocks
- Add
Tests/MockingMacrosTests/Macros/MockedPropertyMacro/MockedPropertyMacro_ExpansionErrorTests.swift testing the error when applied to a non-property declaration
What area needs maintenance?
@_MockedPropertymacro test coverage inTests/MockingMacrosTests/Macros/MockedPropertyMacro/.Why is this improvement needed?
When subscript support was added in PR #148,
@_MockedSubscriptgained actor expansion tests (MockedSubscript_ActorTests.swift) verifyingnonisolatedmodifiers are generated correctly whenisMockAnActor: true, and expansion error tests (MockedSubscriptMacro_ExpansionErrorTests.swift) verifying the macro emits a diagnostic when applied to a non-subscript declaration.@_MockedPropertyhas neither. The existingassertMockedPropertyhelper also hard-codesisMockAnActor: false, so actor scenarios cannot be tested at all.Proposed solution
isMockAnActor: Bool = falseparameter toassertMockedPropertyinTests/MockingMacrosTests/Macros/MockedPropertyMacro/TestHelpers/AssertMockedProperty.swiftTests/MockingMacrosTests/Macros/MockedPropertyMacro/MockedProperty_ActorTests.swifttesting read-only and read-write property expansion in actor mocksTests/MockingMacrosTests/Macros/MockedPropertyMacro/MockedPropertyMacro_ExpansionErrorTests.swifttesting the error when applied to a non-property declaration