Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 7f85e02
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date:   Wed Dec 20 01:10:31 2023 +0400

    Support for variadic types as method arguments (#1241)

    * Added support for variadic types as method arguments

    * Added changelog entry

    * added example protocol with varargs

    * support for vararg in return type's closure

    * added missing member lookup
  • Loading branch information
art-divin committed Dec 19, 2023
1 parent 4f7d246 commit 48816e2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Templates/Tests/Expected/AutoMockable.expected
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,34 @@ class ExampleVarargMock: ExampleVararg {



//MARK: - string

var stringKeyArgsCallsCount = 0
var stringKeyArgsCalled: Bool {
return stringKeyArgsCallsCount > 0
}
var stringKeyArgsReceivedArguments: (key: String, args: CVarArg...)?
var stringKeyArgsReceivedInvocations: [(key: String, args: CVarArg...)] = []
var stringKeyArgsReturnValue: String!
var stringKeyArgsClosure: ((String, CVarArg...) -> String)?

func string(key: String, args: CVarArg...) -> String {
stringKeyArgsCallsCount += 1
stringKeyArgsReceivedArguments = (key: key, args: args)
stringKeyArgsReceivedInvocations.append((key: key, args: args))
if let stringKeyArgsClosure = stringKeyArgsClosure {
return stringKeyArgsClosure(key, args)
} else {
return stringKeyArgsReturnValue
}
}

}
class ExampleVarargMock: ExampleVararg {




//MARK: - string

var stringKeyArgsCallsCount = 0
Expand Down

0 comments on commit 48816e2

Please sign in to comment.