Created
July 11, 2020 22:21
-
-
Save jeremyrempel/97d0dd28ea6fb3778761fb553ef66eb1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AndroidWtfLogUsageDetectorTest : LintDetectorTest() { | |
@Test | |
fun `test given kotlin log wtf usage one failure reported`() { | |
lint() | |
.sdkHome(File("/path/to/Android/Sdk")) | |
.files( | |
java( | |
""" | |
import android.util.Log; | |
public class TestClass1 { | |
public void doSomething() { | |
Log.wtf("wtf", "this is another err"); | |
} | |
} | |
""" | |
).indented() | |
) | |
.run() | |
.expect( | |
""" | |
TestClass1.java:7: Warning: Use Log.f rather than Log.wtf [LogWtfUsage] | |
Log.wtf("wtf", "this is another err"); | |
~~~~~~~ | |
0 errors, 1 warnings | |
""" | |
) | |
} | |
override fun getDetector() = AndroidWtfLogUsageDetector() | |
override fun getIssues() = listOf(AndroidWtfLogUsageDetector.ISSUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment