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 <[email protected]>
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 04d917e commit 4f7d246
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
18 changes: 0 additions & 18 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@
"version" : "0.9.1"
}
},
{
"identity" : "cwlcatchexception",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mattgallagher/CwlCatchException.git",
"state" : {
"revision" : "f809deb30dc5c9d9b78c872e553261a61177721a",
"version" : "2.0.0"
}
},
{
"identity" : "cwlpreconditiontesting",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git",
"state" : {
"revision" : "02b7a39a99c4da27abe03cab2053a9034379639f",
"version" : "2.0.0"
}
},
{
"identity" : "nimble",
"kind" : "remoteSourceControl",
Expand Down
28 changes: 28 additions & 0 deletions Templates/Tests/Expected/AutoMockable.expected
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,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 4f7d246

Please sign in to comment.