Skip to content

Commit

Permalink
Fix failed test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshiki-tsukada committed Dec 21, 2024
1 parent d7791d1 commit de37c38
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
44 changes: 22 additions & 22 deletions Tests/SpyableMacroTests/Factories/UT_SpyFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class UT_SpyFactory: XCTestCase {
try assertProtocol(
withDeclaration: "protocol Foo {}",
expectingClassDeclaration: """
class FooSpy: Foo {
class FooSpy: Foo, @unchecked Sendable {
init() {
}
}
Expand All @@ -25,7 +25,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ServiceSpy: Service {
class ServiceSpy: Service, @unchecked Sendable {
init() {
}
var fetchCallsCount = 0
Expand All @@ -50,7 +50,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ViewModelProtocolSpy: ViewModelProtocol {
class ViewModelProtocolSpy: ViewModelProtocol, @unchecked Sendable {
init() {
}
var fooTextCountCallsCount = 0
Expand Down Expand Up @@ -79,7 +79,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ViewModelProtocolSpy: ViewModelProtocol {
class ViewModelProtocolSpy: ViewModelProtocol, @unchecked Sendable {
init() {
}
var fooModelCallsCount = 0
Expand Down Expand Up @@ -108,7 +108,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ViewModelProtocolSpy: ViewModelProtocol {
class ViewModelProtocolSpy: ViewModelProtocol, @unchecked Sendable {
init() {
}
var fooModelCallsCount = 0
Expand Down Expand Up @@ -137,7 +137,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ViewModelProtocolSpy: ViewModelProtocol {
class ViewModelProtocolSpy: ViewModelProtocol, @unchecked Sendable {
init() {
}
var fooModelCallsCount = 0
Expand Down Expand Up @@ -166,7 +166,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ViewModelProtocolSpy: ViewModelProtocol {
class ViewModelProtocolSpy: ViewModelProtocol, @unchecked Sendable {
init() {
}
var fooModelCallsCount = 0
Expand Down Expand Up @@ -202,7 +202,7 @@ final class UT_SpyFactory: XCTestCase {
assertBuildResult(
result,
"""
class ViewModelProtocolSpy: ViewModelProtocol {
class ViewModelProtocolSpy: ViewModelProtocol, @unchecked Sendable {
init() {
}
var fooTextValueCallsCount = 0
Expand Down Expand Up @@ -236,7 +236,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ViewModelProtocolSpy: ViewModelProtocol {
class ViewModelProtocolSpy: ViewModelProtocol, @unchecked Sendable {
init() {
}
var fooActionCallsCount = 0
Expand Down Expand Up @@ -265,7 +265,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ViewModelProtocolSpy: ViewModelProtocol {
class ViewModelProtocolSpy: ViewModelProtocol, @unchecked Sendable {
init() {
}
var fooActionCallsCount = 0
Expand All @@ -290,7 +290,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class BarSpy: Bar {
class BarSpy: Bar, @unchecked Sendable {
init() {
}
var printCallsCount = 0
Expand Down Expand Up @@ -320,7 +320,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ServiceProtocolSpy: ServiceProtocol {
class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
init() {
}
var fooTextCountCallsCount = 0
Expand Down Expand Up @@ -354,7 +354,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ServiceProtocolSpy: ServiceProtocol {
class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
init() {
}
var fooCallsCount = 0
Expand Down Expand Up @@ -392,7 +392,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ServiceProtocolSpy: ServiceProtocol {
class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
init() {
}
var fooCallsCount = 0
Expand Down Expand Up @@ -422,7 +422,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ServiceProtocolSpy: ServiceProtocol {
class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
init() {
}
var fooCallsCount = 0
Expand Down Expand Up @@ -452,7 +452,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ServiceProtocolSpy: ServiceProtocol {
class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
init() {
}
var data: Data {
Expand All @@ -477,7 +477,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ServiceProtocolSpy: ServiceProtocol {
class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
init() {
}
var data: Data?
Expand All @@ -494,7 +494,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ServiceProtocolSpy: ServiceProtocol {
class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
init() {
}
var data: String!
Expand All @@ -511,7 +511,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ServiceProtocolSpy: ServiceProtocol {
class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
init() {
}
var data: any Codable {
Expand All @@ -536,7 +536,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class ServiceProtocolSpy: ServiceProtocol {
class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
init() {
}
var completion: () -> Void {
Expand All @@ -563,7 +563,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class FooSpy<Key: Hashable>: Foo {
class FooSpy<Key: Hashable>: Foo, @unchecked Sendable {
init() {
}
}
Expand All @@ -580,7 +580,7 @@ final class UT_SpyFactory: XCTestCase {
}
""",
expectingClassDeclaration: """
class FooSpy<Key: Hashable, Value>: Foo {
class FooSpy<Key: Hashable, Value>: Foo, @unchecked Sendable {
init() {
}
}
Expand Down
22 changes: 11 additions & 11 deletions Tests/SpyableMacroTests/Macro/UT_SpyableMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ final class UT_SpyableMacro: XCTestCase {
\(protocolDeclaration)
public class ServiceProtocolSpy: ServiceProtocol {
public class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
public init() {
}
public var name: String {
Expand Down Expand Up @@ -223,7 +223,7 @@ final class UT_SpyableMacro: XCTestCase {
\(protocolDeclaration)
class MyProtocolSpy: MyProtocol {
class MyProtocolSpy: MyProtocol, @unchecked Sendable {
init() {
}
}
Expand All @@ -244,7 +244,7 @@ final class UT_SpyableMacro: XCTestCase {
\(protocolDeclaration)
class MyProtocolSpy: MyProtocol {
class MyProtocolSpy: MyProtocol, @unchecked Sendable {
init() {
}
}
Expand All @@ -266,7 +266,7 @@ final class UT_SpyableMacro: XCTestCase {
\(protocolDeclaration)
#if CUSTOM
class MyProtocolSpy: MyProtocol {
class MyProtocolSpy: MyProtocol, @unchecked Sendable {
init() {
}
}
Expand All @@ -293,7 +293,7 @@ final class UT_SpyableMacro: XCTestCase {
\(protocolDeclaration)
#if CUSTOM
class MyProtocolSpy: MyProtocol {
class MyProtocolSpy: MyProtocol, @unchecked Sendable {
init() {
}
}
Expand All @@ -315,7 +315,7 @@ final class UT_SpyableMacro: XCTestCase {
\(protocolDeclaration)
class MyProtocolSpy: MyProtocol {
class MyProtocolSpy: MyProtocol, @unchecked Sendable {
init() {
}
}
Expand Down Expand Up @@ -353,7 +353,7 @@ final class UT_SpyableMacro: XCTestCase {
let myCustomFlag = "DEBUG"
\(protocolDeclaration)
class MyProtocolSpy: MyProtocol {
class MyProtocolSpy: MyProtocol, @unchecked Sendable {
init() {
}
}
Expand Down Expand Up @@ -404,7 +404,7 @@ final class UT_SpyableMacro: XCTestCase {
\(protocolDefinition)
\(mapping.spyClassAccessLevel) class ServiceProtocolSpy: ServiceProtocol {
\(mapping.spyClassAccessLevel) class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
\(mapping.spyClassAccessLevel) init() {
}
\(mapping.spyClassAccessLevel)
Expand Down Expand Up @@ -458,7 +458,7 @@ final class UT_SpyableMacro: XCTestCase {
\(protocolDefinition)
\(mapping.spyClassAccessLevel) class ServiceProtocolSpy: ServiceProtocol {
\(mapping.spyClassAccessLevel) class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
\(mapping.spyClassAccessLevel) init() {
}
\(mapping.spyClassAccessLevel)
Expand Down Expand Up @@ -503,7 +503,7 @@ final class UT_SpyableMacro: XCTestCase {
\(protocolDeclaration)
fileprivate class ServiceProtocolSpy: ServiceProtocol {
fileprivate class ServiceProtocolSpy: ServiceProtocol, @unchecked Sendable {
fileprivate init() {
}
fileprivate
Expand Down Expand Up @@ -546,7 +546,7 @@ final class UT_SpyableMacro: XCTestCase {
\(protocolDeclaration)
#if CUSTOM_FLAG
package class MyProtocolSpy: MyProtocol {
package class MyProtocolSpy: MyProtocol, @unchecked Sendable {
package init() {
}
}
Expand Down

0 comments on commit de37c38

Please sign in to comment.