woshiccm / Pecker

CodePecker is a tool to detect unused Swift code.
MIT License
1.46k stars 63 forks source link

False Positive: Test methods in extensions #39

Closed AdamPro13 closed 4 years ago

AdamPro13 commented 4 years ago

It looks like test methods declared in extensions currently show warnings as false positives despite the xctest rule being enabled. The following testExample() method shows a warning.

class MyTestClass: XCTestCase {
}

extension MyTestClass {
    func testExample() { // This shows a warning as being unused
        XCTAssertTrue(true)
    }
}
woshiccm commented 4 years ago

Fixed, the version is 0.0.12