@@ -19,11 +19,23 @@ def works_with_acronyms():
1919
2020 def works_with_numbers ():
2121 assert camel_to_snake ("Python3Script" ) == "python3_script"
22+ assert camel_to_snake ("sha256Hash" ) == "sha256_hash"
2223 assert camel_to_snake ("camel2snake" ) == "camel2snake"
2324
2425 def keeps_already_snake ():
2526 assert camel_to_snake ("snake_case" ) == "snake_case"
2627
28+ def handles_empty_string ():
29+ assert camel_to_snake ("" ) == ""
30+
31+ def handles_single_character ():
32+ assert camel_to_snake ("A" ) == "a"
33+ assert camel_to_snake ("a" ) == "a"
34+
35+ def preserves_leading_and_trailing_underscores ():
36+ assert camel_to_snake ("_Private" ) == "_private"
37+ assert camel_to_snake ("CamelCase_" ) == "camel_case_"
38+
2739
2840def describe_snake_to_camel ():
2941 def converts_typical_names ():
@@ -43,6 +55,7 @@ def works_with_acronyms():
4355
4456 def works_with_numbers ():
4557 assert snake_to_camel ("python3_script" ) == "Python3Script"
58+ assert snake_to_camel ("sha256_hash" ) == "Sha256Hash"
4659 assert snake_to_camel ("snake2camel" ) == "Snake2camel"
4760
4861 def keeps_already_camel ():
@@ -54,3 +67,12 @@ def can_produce_lower_camel_case():
5467 snake_to_camel ("input_object_type_extension_node" , False )
5568 == "inputObjectTypeExtensionNode"
5669 )
70+
71+ def handles_empty_string ():
72+ assert snake_to_camel ("" ) == ""
73+
74+ def handles_single_character ():
75+ assert snake_to_camel ("a" ) == "A"
76+
77+ def preserves_trailing_underscore ():
78+ assert snake_to_camel ("snake_case_" ) == "SnakeCase_"
0 commit comments