Fix stdx::to_snake_case

This commit is contained in:
crauzer 2021-10-06 23:24:47 +02:00
parent 1161fa45af
commit a4f08c117f
2 changed files with 40 additions and 14 deletions

View file

@ -161,6 +161,7 @@ mod tests {
check(to_lower_snake_case, "lowerCamelCase", expect![["lower_camel_case"]]);
check(to_lower_snake_case, "a", expect![[""]]);
check(to_lower_snake_case, "abc", expect![[""]]);
check(to_lower_snake_case, "foo__bar", expect![["foo_bar"]]);
}
#[test]
@ -192,5 +193,7 @@ mod tests {
check(to_upper_snake_case, "A", expect![[""]]);
check(to_upper_snake_case, "ABC", expect![[""]]);
check(to_upper_snake_case, "X86_64", expect![[""]]);
check(to_upper_snake_case, "FOO_BAr", expect![["FOO_BAR"]]);
check(to_upper_snake_case, "FOO__BAR", expect![["FOO_BAR"]]);
}
}