Comments (6)
Seems like we have to add option to skip unknown tokens or ignore comment tokens. Thanks for the report.
from cuckoo.
I wasn't able to reproduce your problem. Could you please try it with new version (0.5.0) and send us the file which causes this error?
from cuckoo.
Unfortunately, same happens with 0.5.0 version.
The problematic source code is
import UIKit
/**
* This is the protocol for the repeatable UI elements that can be reused.
*/
public protocol Reusable {
/**
* The reuse identifier of the element.
*/
var reuseIdentifier: String? { get }
}
// MARK: - UITableViewCell
public extension Reusable where Self: UITableViewCell {
}
I use the generator command
Pods/Cuckoo/run generate --testable MyProj --output out.swift Reusable.swift
and get the
Unknown kind: source.lang.swift.syntaxtype.comment.mark
Unknown kind: source.lang.swift.decl.extension
The out.swift looks like this (notice public
declaration above import Cuckoo
):
// MARK: - Mocks generated from file: Reusable.swift at 2016-06-16 09:54:23 +0000
import UIKit
/**
* This is the protocol for the repeatable UI elements that can be reused.
*/
public
import Cuckoo
@testable import MyProj
public class MockReusable: Reusable, Cuckoo.Mock {
public let manager: Cuckoo.MockManager<__StubbingProxy_Reusable, __VerificationProxy_Reusable> = Cuckoo.MockManager()
private var observed: Reusable?
public required init() {
observed = nil
}
public required init(spyOn victim: Reusable) {
observed = victim
}
public var reuseIdentifier: String? {
get {
return manager.getter("reuseIdentifier", original: observed.map { o in return { () -> String? in o.reuseIdentifier } })()
}
}
public struct __StubbingProxy_Reusable: Cuckoo.StubbingProxy {
let handler: Cuckoo.StubbingHandler
public init(handler: Cuckoo.StubbingHandler) {
self.handler = handler
}
var reuseIdentifier: ToBeStubbedReadOnlyProperty<String?> {
return handler.stubReadOnlyProperty("reuseIdentifier")
}
}
public struct __VerificationProxy_Reusable: Cuckoo.VerificationProxy {
let handler: Cuckoo.VerificationHandler
public init(handler: Cuckoo.VerificationHandler) {
self.handler = handler
}
var reuseIdentifier: VerifyReadOnlyProperty<String?> {
return handler.verifyReadOnlyProperty("reuseIdentifier")
}
}
}
from cuckoo.
@FilipDolnik Seems to be a bug in FileHeaderHandler.
from cuckoo.
Problem is with the public modificator. So this is raw code which won`t work.
public protocol Reusable {
}
All attributes like @objc causes this as well. Temporary workaround is to use --no-header parameter.
from cuckoo.
Should be fixed in 0.5.1. Please try it out! :)
from cuckoo.
Related Issues (20)
- Add support for Protocols requiring AnyActor conformance HOT 4
- Permission denied: Can't add comments to the list of files HOT 4
- Strip conflicting imports HOT 2
- Compilation fails in Xcode 14.3
- Error when running Cuckoo/run (cuckoo_generator ver. 1.10.2) HOT 4
- Unable to build with SPM install (ld: symbol(s) not found for architecture arm64) HOT 8
- Cuckoo need XCTest.framework in link binary with Libraries section. otherwise it shows error that is "cannot find 'XCTFail' in scope" in MockManager.swift file HOT 1
- Throwing "'some' types are only permitted in properties, subscripts, and functions" when `func` throws & has `some` for its parameter HOT 2
- Compiler custom flags are not supported by Cuckoo generator HOT 2
- Cuckoo does not support block-type closure HOT 2
- Carthage/Checkouts/Cuckoo/Generator/Generator.xcodeproj' does not exist. HOT 9
- Plenty errors in GeneratedMocks.ts for swift 5.8.1 HOT 2
- Error: Expected member name or constructor call after type name HOT 28
- Issue with Cuckoo Generating Mock for a variable's property HOT 1
- Mock restricts subclasses for method argument HOT 4
- Issue with variable name as `extension` HOT 1
- Problem with run script on Xcode 15 HOT 6
- Not able to initialise Mock Object HOT 1
- More descriptive failure messages HOT 1
- 2.0 issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cuckoo.