Tests for case helpers
@@ -29,3 +29,19 @@ pub fn to_snake(preamble: &str, camel: &str) -> String {
snake
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ #[test]
+ fn to_snake_works() {
+ assert_eq!(to_snake("", "Windows"), "windows".to_owned());
+ assert_eq!(
+ to_snake("", "ApplicationModel"),
+ "application_model".to_owned()
+ );
+ // assert_eq!(to_snake("", "UIProgramming"), "ui_programming".to_owned());
+ // assert_eq!(to_snake("", "CreateU8Array"), "create_u8_array".to_owned());
+ assert_eq!(to_snake("awesome", "Windows"), "awesome_windows".to_owned());
+ }
+}
