1
1
mirror of https://github.com/wader/fq.git synced 2024-12-01 02:30:32 +03:00
fq/format/msgpack/testdata/test.fqtest
Mattias Wadman fc0aacb654 interp: Cleanup display aliases, now: d, da, dd, dv, ddv
Think it makes sense to have them all start with d.
Also f is often used as function argument name.
2022-01-28 18:25:38 +01:00

104 lines
9.2 KiB
Plaintext

# msgpack-tools
# echo '{"array": [1,2,3], "object": {"key": "value"}, "number": 123, "string": "abc", "true": true, "false": false, "null": null}' | json2msgpack > test.msgpack
$ fq -d msgpack dv test.msgpack
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: test.msgpack (msgpack) 0x0-0x42.7 (67)
0x00|87 |. | type: "fixmap" (0x87) 0x0-0x0.7 (1)
0x00|87 |. | length: 7 0x0.4-0x0.7 (0.4)
| | | pairs[0:7]: 0x1-0x42.7 (66)
| | | [0]{}: pair 0x1-0xa.7 (10)
| | | key{}: 0x1-0x6.7 (6)
0x00| a5 | . | type: "fixstr" (0xa5) 0x1-0x1.7 (1)
0x00| a5 | . | length: 5 0x1.4-0x1.7 (0.4)
0x00| 61 72 72 61 79 | array | value: "array" 0x2-0x6.7 (5)
| | | value{}: 0x7-0xa.7 (4)
0x00| 93 | . | type: "fixarray" (0x93) 0x7-0x7.7 (1)
0x00| 93 | . | length: 3 0x7.4-0x7.7 (0.4)
| | | elements[0:3]: 0x8-0xa.7 (3)
| | | [0]{}: element 0x8-0x8.7 (1)
0x00| 01 | . | type: "positive_fixint" (0x1) 0x8-0x8.7 (1)
0x00| 01 | . | value: 1 0x8-0x8.7 (1)
| | | [1]{}: element 0x9-0x9.7 (1)
0x00| 02 | . | type: "positive_fixint" (0x2) 0x9-0x9.7 (1)
0x00| 02 | . | value: 2 0x9-0x9.7 (1)
| | | [2]{}: element 0xa-0xa.7 (1)
0x00| 03 | . | type: "positive_fixint" (0x3) 0xa-0xa.7 (1)
0x00| 03 | . | value: 3 0xa-0xa.7 (1)
| | | [1]{}: pair 0xb-0x1c.7 (18)
| | | key{}: 0xb-0x11.7 (7)
0x00| a6 | . | type: "fixstr" (0xa6) 0xb-0xb.7 (1)
0x00| a6 | . | length: 6 0xb.4-0xb.7 (0.4)
0x00| 6f 62 6a 65| obje| value: "object" 0xc-0x11.7 (6)
0x10|63 74 |ct |
| | | value{}: 0x12-0x1c.7 (11)
0x10| 81 | . | type: "fixmap" (0x81) 0x12-0x12.7 (1)
0x10| 81 | . | length: 1 0x12.4-0x12.7 (0.4)
| | | pairs[0:1]: 0x13-0x1c.7 (10)
| | | [0]{}: pair 0x13-0x1c.7 (10)
| | | key{}: 0x13-0x16.7 (4)
0x10| a3 | . | type: "fixstr" (0xa3) 0x13-0x13.7 (1)
0x10| a3 | . | length: 3 0x13.4-0x13.7 (0.4)
0x10| 6b 65 79 | key | value: "key" 0x14-0x16.7 (3)
| | | value{}: 0x17-0x1c.7 (6)
0x10| a5 | . | type: "fixstr" (0xa5) 0x17-0x17.7 (1)
0x10| a5 | . | length: 5 0x17.4-0x17.7 (0.4)
0x10| 76 61 6c 75 65 | value | value: "value" 0x18-0x1c.7 (5)
| | | [2]{}: pair 0x1d-0x24.7 (8)
| | | key{}: 0x1d-0x23.7 (7)
0x10| a6 | . | type: "fixstr" (0xa6) 0x1d-0x1d.7 (1)
0x10| a6 | . | length: 6 0x1d.4-0x1d.7 (0.4)
0x10| 6e 75| nu| value: "number" 0x1e-0x23.7 (6)
0x20|6d 62 65 72 |mber |
| | | value{}: 0x24-0x24.7 (1)
0x20| 7b | { | type: "positive_fixint" (0x7b) 0x24-0x24.7 (1)
0x20| 7b | { | value: 123 0x24-0x24.7 (1)
| | | [3]{}: pair 0x25-0x2f.7 (11)
| | | key{}: 0x25-0x2b.7 (7)
0x20| a6 | . | type: "fixstr" (0xa6) 0x25-0x25.7 (1)
0x20| a6 | . | length: 6 0x25.4-0x25.7 (0.4)
0x20| 73 74 72 69 6e 67 | string | value: "string" 0x26-0x2b.7 (6)
| | | value{}: 0x2c-0x2f.7 (4)
0x20| a3 | . | type: "fixstr" (0xa3) 0x2c-0x2c.7 (1)
0x20| a3 | . | length: 3 0x2c.4-0x2c.7 (0.4)
0x20| 61 62 63| abc| value: "abc" 0x2d-0x2f.7 (3)
| | | [4]{}: pair 0x30-0x35.7 (6)
| | | key{}: 0x30-0x34.7 (5)
0x30|a4 |. | type: "fixstr" (0xa4) 0x30-0x30.7 (1)
0x30|a4 |. | length: 4 0x30.4-0x30.7 (0.4)
0x30| 74 72 75 65 | true | value: "true" 0x31-0x34.7 (4)
| | | value{}: 0x35-0x35.7 (1)
0x30| c3 | . | type: "true" (0xc3) 0x35-0x35.7 (1)
| | | value: true 0x36-NA (0)
| | | [5]{}: pair 0x36-0x3c.7 (7)
| | | key{}: 0x36-0x3b.7 (6)
0x30| a5 | . | type: "fixstr" (0xa5) 0x36-0x36.7 (1)
0x30| a5 | . | length: 5 0x36.4-0x36.7 (0.4)
0x30| 66 61 6c 73 65 | false | value: "false" 0x37-0x3b.7 (5)
| | | value{}: 0x3c-0x3c.7 (1)
0x30| c2 | . | type: "false" (0xc2) 0x3c-0x3c.7 (1)
| | | value: false 0x3d-NA (0)
| | | [6]{}: pair 0x3d-0x42.7 (6)
| | | key{}: 0x3d-0x41.7 (5)
0x30| a4 | . | type: "fixstr" (0xa4) 0x3d-0x3d.7 (1)
0x30| a4 | . | length: 4 0x3d.4-0x3d.7 (0.4)
0x30| 6e 75| nu| value: "null" 0x3e-0x41.7 (4)
0x40|6c 6c |ll |
| | | value{}: 0x42-0x42.7 (1)
0x40| c0| | .| | type: "nil" (0xc0) 0x42-0x42.7 (1)
| | | value: null 0x43-NA (0)
$ fq -d msgpack torepr test.msgpack
{
"array": [
1,
2,
3
],
"false": false,
"null": null,
"number": 123,
"object": {
"key": "value"
},
"string": "abc",
"true": true
}