Skip to content

Commit ee5a291

Browse files
committed
add a test case
1 parent 1869ae8 commit ee5a291

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_template.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ def test_tojavascript_with_dict():
1919
assert tojavascript(dict_obj) == '{\n "key": "value",\n}'
2020

2121

22+
def test_tojavascript_with_dict_with_mixed_key_types():
23+
dict_obj = {"key": "value", 1: "another value", 3.14: "pi"}
24+
expected = '{\n "key": "value",\n 1: "another value",\n 3.14: "pi",\n}'
25+
assert tojavascript(dict_obj) == expected
26+
27+
2228
def test_tojavascript_with_list():
2329
list_obj = ["value1", "value2"]
2430
assert tojavascript(list_obj) == '[\n"value1",\n"value2",\n]'

0 commit comments

Comments
 (0)