We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I saw the issue #83 was implemented however I had some observations.
Given a source file source.swift;
source.swift
#if DEBUG import X #elseif RELEASE import Y #endif /// @mockable protocol SwiftTest {}
mockolo -srcs source.swift -d Mock.swift && cat Mock.swift outputs;
mockolo -srcs source.swift -d Mock.swift && cat Mock.swift
#if DEBUG import X #endif #if RELEASE import Y #endif
which is reflected correctly.
However;
#if DEBUG import X #else import Y #endif /// @mockable protocol SwiftTest {}
outputs;
import X import Y #if DEBUG import X #endif
which is incorrect. import Y should only be there for #else case.
import Y
#else
Another observation (I don't know if this is supported or not) I had was compiler directives are not working inside the protocol definitions.
protocol
/// @mockable protocol SwiftCompilerTest { #if compiler(<4.0) func swiftLessThan4() #else func swift() #endif }
class SwiftCompilerTestMock: SwiftCompilerTest { init() { } #if compiler(<4.0) private(set) var swiftLessThan4CallCount = 0 var swiftLessThan4Handler: (() -> ())? func swiftLessThan4() { swiftLessThan4CallCount += 1 if let swiftLessThan4Handler = swiftLessThan4Handler { swiftLessThan4Handler() } } #endif }
func swift() seems to be completely ignored in this case.
func swift()
2.1.1
swift: swiftlang-6.0.0.9.10 clang-1600.0.26.2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I saw the issue #83 was implemented however I had some observations.
Given a source file
source.swift
;mockolo -srcs source.swift -d Mock.swift && cat Mock.swift
outputs;which is reflected correctly.
However;
outputs;
which is incorrect.
import Y
should only be there for#else
case.Another observation (I don't know if this is supported or not) I had was compiler directives are not working inside the
protocol
definitions.outputs;
func swift()
seems to be completely ignored in this case.2.1.1
swift: swiftlang-6.0.0.9.10 clang-1600.0.26.2
The text was updated successfully, but these errors were encountered: