Brightify / Cuckoo

Boilerplate-free mocking framework for Swift!
MIT License
1.67k stars 174 forks source link

Unterminated string literal when mocking function with long callback #419

Closed bbrk24 closed 1 year ago

bbrk24 commented 2 years ago

I'm mocking a protocol with a function that looks like this:

func foo(
    completion: @escaping (
        _ bar: Int,
        _ baz: Int,
        _ qux: Int
    ) -> Void
)

The generated mocks do not properly remove the line breaks before attempting to put it into a single-line string literal, resulting in the errors Unterminated string literal, Consecutive statements on a line must be separated by ';', Expected expression, and '_' can only appear in a pattern or on the left side of an assignment, several times each.