-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
130 additions
and
20 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
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
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
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
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
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 @@ | ||
This is an android library providing a lint rule |
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
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
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
62 changes: 62 additions & 0 deletions
62
linter/src/test/kotlin/com/cmgapps/lint/IssueRegistryShould.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,62 @@ | ||
/* | ||
* Copyright (c) 2022. Christian Grach <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.cmgapps.lint | ||
|
||
import com.android.tools.lint.client.api.LintClient | ||
import com.android.tools.lint.detector.api.CURRENT_API | ||
import org.hamcrest.MatcherAssert.assertThat | ||
import org.hamcrest.Matchers.allOf | ||
import org.hamcrest.Matchers.contains | ||
import org.hamcrest.Matchers.hasProperty | ||
import org.hamcrest.Matchers.`is` | ||
import org.junit.jupiter.api.BeforeEach | ||
import org.junit.jupiter.api.Test | ||
|
||
internal class IssueRegistryShould { | ||
|
||
private lateinit var registry: IssueRegistry | ||
|
||
@Suppress("UnstableApiUsage") | ||
@BeforeEach | ||
fun setUp() { | ||
LintClient.clientName = LintClient.CLIENT_UNIT_TESTS | ||
registry = IssueRegistry() | ||
} | ||
|
||
@Test | ||
fun `have API version`() { | ||
assertThat(registry.api, `is`(CURRENT_API)) | ||
} | ||
|
||
@Test | ||
fun `have issues registered`() { | ||
assertThat(registry.issues, contains(LogTagDetector.ISSUE)) | ||
} | ||
|
||
@Test | ||
fun `have a vendor`() { | ||
assertThat( | ||
registry.vendor, | ||
allOf( | ||
hasProperty("vendorName", `is`("CMG Mobile Apps")), | ||
hasProperty("identifier", `is`("log-tag")), | ||
hasProperty("feedbackUrl", `is`("https://github.com/chrimaeon/logtag-kapt/issues")), | ||
hasProperty("contact", `is`("https://github.com/chrimaeon/logtag-kapt/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