From 1cab933d085a1288e7214a5bb615ab27204ce18e Mon Sep 17 00:00:00 2001 From: ssmith Date: Sun, 14 May 2006 20:59:40 -0700 Subject: Add tests for other dict key types. --- tests.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3