v / vlib / encoding / cbor / tests / cbor_wg / appA_streaming.edn
72 lines · 72 sloc · 2.47 KB · 468855eef1db0ff73c62be2d1bf176ffa0e1478e
Raw
1{
2 "title": "streaming",
3 "description": "Streaming, from RFC 8949 appendix A",
4 "tests": [
5 {
6 "description": "Streamed byte string",
7 "roundtrip": false, # decoded version is de-streamed.
8 "encoded": h'5f42010243030405ff',
9 "decoded": (_ h'0102', h'030405'),
10 },
11 {
12 "description": "Streamed UTF8 string",
13 "roundtrip": false, # decoded version is de-streamed.
14 "encoded": h'7f657374726561646d696e67ff',
15 "decoded": (_ "strea", "ming"),
16 },
17 {
18 "description": "Streamed array",
19 "roundtrip": false, # decoded version is de-streamed.
20 "encoded": h'9fff',
21 "decoded": [_ ],
22 },
23 {
24 "description": "Streamed array, nested non-streamed then streamed arrays",
25 "roundtrip": false, # decoded version is de-streamed.
26 "encoded": h'9f018202039f0405ffff',
27 "decoded": [_ 1, [2, 3], [_ 4, 5]],
28 },
29 {
30 "description": "Streamed array, nested non-streamed arrays",
31 "roundtrip": false, # decoded version is de-streamed.
32 "encoded": h'9f01820203820405ff',
33 "decoded": [_ 1, [2, 3], [4, 5]],
34 },
35 {
36 "description": "Non-Streamed array, nested non-streamed then streamed array",
37 "roundtrip": false, # decoded version is de-streamed.
38 "encoded": h'83018202039f0405ff',
39 "decoded": [1, [2, 3], [_ 4, 5]],
40 },
41 {
42 "description": "Non-Streamed array, nested streamed then non-streamed array",
43 "roundtrip": false, # decoded version is de-streamed.
44 "encoded": h'83019f0203ff820405',
45 "decoded": [1, [_ 2, 3], [4, 5]],
46 },
47 {
48 "description": "Longer streamed array of ints",
49 "roundtrip": false, # decoded version is de-streamed.
50 "encoded": h'9f0102030405060708090a0b0c0d0e0f101112131415161718181819ff',
51 "decoded": [_ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25],
52 },
53 {
54 "description": "Streamed map",
55 "roundtrip": false, # decoded version is de-streamed.
56 "encoded": h'bf61610161629f0203ffff',
57 "decoded": {_ "a": 1, "b": [_ 2, 3]},
58 },
59 {
60 "description": "Array with nested streamed map",
61 "roundtrip": false, # decoded version is de-streamed.
62 "encoded": h'826161bf61626163ff',
63 "decoded": ["a", {_ "b": "c"}],
64 },
65 {
66 "description": "Plain streamed map",
67 "roundtrip": false, # decoded version is de-streamed.
68 "encoded": h'bf6346756ef563416d7421ff',
69 "decoded": {_ "Fun": true, "Amt": -2},
70 },
71 ],
72}
73