From d4cb10d3eb10b1e3b3304f8e0e07a2179dd6d792 Mon Sep 17 00:00:00 2001 From: Philip Koperski Date: Wed, 14 Jul 2021 09:54:07 -0400 Subject: [PATCH] Add tests for camel_case and snake_case --- test/std/string/camel_case_test.ds | 12 ++++++++++++ test/std/string/snake_case_test.ds | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/std/string/camel_case_test.ds create mode 100644 test/std/string/snake_case_test.ds diff --git a/test/std/string/camel_case_test.ds b/test/std/string/camel_case_test.ds new file mode 100644 index 0000000..dc19d9c --- /dev/null +++ b/test/std/string/camel_case_test.ds @@ -0,0 +1,12 @@ + +fn test_without_symbols + output = camel_case "hello world 22" + + assert_eq ${output} "HelloWorld22" +end + +fn test_with_symbols + output = camel_case "hello!@#$% world^&*()[]{}22" + + assert_eq ${output} "HelloWorld22" +end diff --git a/test/std/string/snake_case_test.ds b/test/std/string/snake_case_test.ds new file mode 100644 index 0000000..1ee9947 --- /dev/null +++ b/test/std/string/snake_case_test.ds @@ -0,0 +1,12 @@ + +fn test_without_symbols + output = snake_case "hello world 22" + + assert_eq ${output} "hello_world_22" +end + +fn test_with_symbols + output = snake_case "hello!@#$% world^&*()[]{}22" + + assert_eq ${output} "hello_world_22" +end