-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add coverage for lint issue registry. (#385)
- Loading branch information
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
33 changes: 33 additions & 0 deletions
33
formula-lint/src/test/java/com/instacart/formula/lint/FormulaIssueRegistryTest.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.instacart.formula.lint | ||
|
||
import com.android.tools.lint.checks.infrastructure.TestLintTask | ||
import com.android.tools.lint.detector.api.CURRENT_API | ||
import com.google.common.truth.Truth | ||
import org.junit.Test | ||
|
||
@Suppress("CheckResult") | ||
class FormulaIssueRegistryTest { | ||
|
||
@Test fun issues() { | ||
TestLintTask.lint() | ||
|
||
val issues = FormulaIssueRegistry().issues | ||
Truth.assertThat(issues).hasSize(2) | ||
} | ||
|
||
@Test fun apiVersions() { | ||
TestLintTask.lint() | ||
|
||
Truth.assertThat(FormulaIssueRegistry().api).isEqualTo(CURRENT_API) | ||
Truth.assertThat(FormulaIssueRegistry().minApi).isEqualTo(7) | ||
} | ||
|
||
@Test fun vendor() { | ||
TestLintTask.lint() | ||
|
||
val vendor = FormulaIssueRegistry().vendor | ||
Truth.assertThat(vendor.vendorName).isEqualTo("Instacart/formula") | ||
Truth.assertThat(vendor.identifier).isEqualTo("com.instacart.formula:formula:{version}") | ||
Truth.assertThat(vendor.feedbackUrl).isEqualTo("https://github.com/Instacart/formula/issues") | ||
} | ||
} |
This file contains 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