-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport of the
String.capitalized()
extension for Pre Gradle 7.4. F…
…ixes #40 (#41) * Fixes #40 * Added unit tests for the port of the capitalization extension function. * Import cleanup.
- Loading branch information
1 parent
ba514c4
commit 1497fe4
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
21 changes: 19 additions & 2 deletions
21
...kotlin/com/dropbox/gradle/plugins/dependencyguard/internal/DependencyTreeDiffTaskNames.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
22 changes: 22 additions & 0 deletions
22
...uard/src/test/kotlin/com/dropbox/gradle/plugins/dependencyguard/internal/TaskNamesTest.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,22 @@ | ||
package com.dropbox.gradle.plugins.dependencyguard.internal | ||
|
||
import com.dropbox.gradle.plugins.dependencyguard.internal.DependencyTreeDiffTaskNames.capitalized | ||
import org.junit.jupiter.api.Assertions.assertEquals | ||
import org.junit.jupiter.api.Test | ||
|
||
class TaskNamesTest { | ||
@Test | ||
fun `new library is added`() { | ||
listOf( | ||
"" to "", | ||
"a" to "A", | ||
"A" to "A", | ||
"aa" to "Aa", | ||
"aaa" to "Aaa", | ||
"aA" to "AA", | ||
"Aa" to "Aa", | ||
).forEach { | ||
assertEquals(it.first.capitalized(), it.second) | ||
} | ||
} | ||
} |