summaryrefslogtreecommitdiff
path: root/tests.erl
diff options
context:
space:
mode:
authorssmith2006-05-14 20:59:40 -0700
committerssmith2006-05-14 20:59:40 -0700
commit1cab933d085a1288e7214a5bb615ab27204ce18e (patch)
treec3703b81b1c290fe543ee6c995ce6a14d19ea267 /tests.erl
parent83a084ccaed3cb6f43d7c9a28dcac4267aba737d (diff)
Add tests for other dict key types.
Diffstat (limited to 'tests.erl')
-rw-r--r--tests.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests.erl b/tests.erl
index ce891be..60b5227 100644
--- a/tests.erl
+++ b/tests.erl
@@ -34,9 +34,15 @@ test_enc_list3() ->
{string, "xyz"}]})).
%% Dict encoding tests
-test_enc_dict() ->
+test_enc_dict1() ->
Dict = dict:from_list([{"age", {int, 25}}, {"eyes", {string, "blue"}}]),
?match("d3:agei25e4:eyes4:bluee", bencode:bencode({dict, Dict})).
+test_enc_dict2() ->
+ Dict = dict:from_list([{age, {int, 25}}, {eyes, {string, "blue"}}]),
+ ?match("d3:agei25e4:eyes4:bluee", bencode:bencode({dict, Dict})).
+test_enc_dict3() ->
+ Dict = dict:from_list([{{string, "age"}, {int, 25}}, {{string, "eyes"}, {string, "blue"}}]),
+ ?match("d3:agei25e4:eyes4:bluee", bencode:bencode({dict, Dict})).
%% Integer decoding tests