@@ -37,10 +37,13 @@ void main() {
37
37
test ("Pack 5-character string" , packString5);
38
38
test ("Pack 22-character string" , packString22);
39
39
test ("Pack 256-character string" , packString256);
40
+ test ("Pack .NET SDK Test" , packDSA);
41
+ test ("Pack negative number -24577" , packNegative1);
42
+ test ("Pack negative number -245778641" , packNegative2);
40
43
test ("Pack string array" , packStringArray);
41
44
test ("Pack int-to-string map" , packIntToStringMap);
42
- test ("Pack 3-field message" , packMessage);
43
- test ("Pack nested message" , packNestedMessage);
45
+ // test("Pack 3-field message", packMessage);
46
+ // test("Pack nested message", packNestedMessage);
44
47
45
48
test ("Unpack 5-character string" , unpackString5);
46
49
test ("Unpack 22-character string" , unpackString22);
@@ -58,6 +61,28 @@ void packString5() {
58
61
expect (encoded, orderedEquals ([165 , 104 , 101 , 108 , 108 , 111 ]));
59
62
}
60
63
64
+ void packDSA () {
65
+ // Use http://kawanet.github.io/msgpack-lite/ to test decode
66
+ // 81 A3 6D 73 67 D1 00 EB
67
+ List <int > testObjData = [0x81 , 0xA3 , 0x6D , 0x73 , 0x67 , 0xD1 , 0x00 , 0xEB ];
68
+ Object obj= unpack (testObjData);
69
+ expect (unpack (testObjData)["msg" ], 235 );
70
+ }
71
+
72
+ void packNegative1 () {
73
+ List <int > encoded = pack (- 24577 );
74
+ expect (encoded, orderedEquals ([0xd1 ,0x9f ,0xff ]));
75
+ Object decoded = unpack (encoded);
76
+ expect (decoded, - 24577 );
77
+ }
78
+
79
+ void packNegative2 () {
80
+ List <int > encoded = pack (- 245778641 );
81
+ expect (encoded, orderedEquals ([0xd2 ,0xf1 ,0x59 ,0xb7 ,0x2f ]));
82
+ Object decoded = unpack (encoded);
83
+ expect (decoded, - 245778641 );
84
+ }
85
+
61
86
void packString22 () {
62
87
List <int > encoded = pack ("hello there, everyone!" );
63
88
expect (encoded, orderedEquals ([
0 commit comments