mirror of
https://github.com/shekhargulati/strman-java.git
synced 2026-10-07 20:23:56 +00:00
Fixed #40. Added support for toSnakeCase function
This commit is contained in:
@@ -776,4 +776,23 @@ public class StrmanTest {
|
||||
|
||||
Arrays.stream(fixture).forEach(el -> assertThat(String.format("toKebabCase(%s) should be de-camelize", el), toKebabCase(el), equalTo("de-camelize")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toSnakeCase_shouldSnakeCaseAString() throws Exception {
|
||||
String[] fixture = {
|
||||
"deCamelize",
|
||||
"de-Camelize",
|
||||
"de camelize",
|
||||
"de camelize",
|
||||
"de Camelize",
|
||||
"de-camelize",
|
||||
"-de--camelize",
|
||||
"de_camelize",
|
||||
" de_camelize"
|
||||
};
|
||||
|
||||
Arrays.stream(fixture).forEach(el -> assertThat(String.format("toSnakeCase(%s) should be de_camelize", el), toSnakeCase(el), equalTo("de_camelize")));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user