Coder Social home page Coder Social logo

Comments (6)

TadeasKriz avatar TadeasKriz commented on May 21, 2024

Seems like we have to add option to skip unknown tokens or ignore comment tokens. Thanks for the report.

from cuckoo.

FilipDolnik avatar FilipDolnik commented on May 21, 2024

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.

ivany4 avatar ivany4 commented on May 21, 2024

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.

TadeasKriz avatar TadeasKriz commented on May 21, 2024

@FilipDolnik Seems to be a bug in FileHeaderHandler.

from cuckoo.

FilipDolnik avatar FilipDolnik commented on May 21, 2024

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.

TadeasKriz avatar TadeasKriz commented on May 21, 2024

Should be fixed in 0.5.1. Please try it out! :)

from cuckoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.