Skip to content

Commit d5b95f1

Browse files
committed
Adding JUnit tests for removeNonNameElementToCamelCase
1 parent 4af82ed commit d5b95f1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

plugin/src/test/java/com/yelp/codegen/KotlinGeneratorTest.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,14 @@ class KotlinGeneratorTest {
1111
assert(KotlinGenerator().toModelName("model with dot.s") == "ModelWithDotS")
1212
assert(KotlinGenerator().toModelName("model with userscore_s") == "ModelWithUserscoreS")
1313
}
14+
15+
@Test
16+
fun removeNonNameElementToCamelCase_withSquareBrackets() {
17+
assert(KotlinGenerator().removeNonNameElementToCamelCase("type[]") == "type")
18+
assert(KotlinGenerator().removeNonNameElementToCamelCase("type[value]") == "typeValue")
19+
assert(KotlinGenerator().removeNonNameElementToCamelCase("type[") == "type")
20+
assert(KotlinGenerator().removeNonNameElementToCamelCase("type]") == "type")
21+
assert(KotlinGenerator().removeNonNameElementToCamelCase("[type]") == "type")
22+
assert(KotlinGenerator().removeNonNameElementToCamelCase("[type]key") == "typeKey")
23+
}
1424
}

0 commit comments

Comments
 (0)