aboutsummaryrefslogtreecommitdiff
path: root/macros/src/util/string.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-10-09 20:41:09 +0200
committerHampusM <hampus@hampusmat.com>2022-10-09 20:42:07 +0200
commitfd5b6786d29d056ff0721a59435b50005f13f05c (patch)
tree3839ff2ffa99a14d1aefb952a55f1cb05aa0f09e /macros/src/util/string.rs
parent5b0c6a52022e67a2d9cee251b3d08b9cb2b5f6cb (diff)
test: add more unit tests
Diffstat (limited to 'macros/src/util/string.rs')
-rw-r--r--macros/src/util/string.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/macros/src/util/string.rs b/macros/src/util/string.rs
index 90cccee..a04a021 100644
--- a/macros/src/util/string.rs
+++ b/macros/src/util/string.rs
@@ -10,3 +10,17 @@ pub fn camelcase_to_snakecase(camelcased: &str) -> String
.to_string()
.to_lowercase()
}
+
+#[cfg(test)]
+mod tests
+{
+ use super::*;
+
+ #[test]
+ fn camelcase_to_snakecase_works()
+ {
+ assert_eq!(camelcase_to_snakecase("LoginHandler"), "login_handler");
+
+ assert_eq!(camelcase_to_snakecase("Regex"), "regex");
+ }
+}