1
1
mirror of https://github.com/wader/fq.git synced 2024-11-27 14:14:58 +03:00
fq/format/json/testdata/json.fqtest
Mattias Wadman 691688022f fqtest: Refactor our script part to own package
Hopefully can be reused for docs generation
2021-10-06 18:49:03 +02:00

61 lines
2.3 KiB
Plaintext

$ fq -d json . /test.json
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x00|7b 0a 20 20 20 20 22 61 22 3a 20 31 32 33 2c 0a|{. "a": 123,.|.: {} /test.json (json)
* |until 0x74.7 (end) (117) | |
$ fq -d json tovalue /test.json
{
"a": 123,
"b": [
1,
2,
3
],
"c:": "string",
"d": null,
"e": 123.4
}
$ fq . /test.json
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x00|7b 0a 20 20 20 20 22 61 22 3a 20 31 32 33 2c 0a|{. "a": 123,.|.: {} /test.json (json)
* |until 0x74.7 (end) (117) | |
$ fq .b[1] /test.json
2
$ fq . /json.gz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /json.gz (gzip)
0x00|1f 8b |.. | identification: "\x1f\x8b" (Correct)
0x0|7b 22 61 22 3a 20 31 32 33 7d |{"a": 123} | uncompressed: {} (json)
0x00| 08 | . | compression_method: deflate (8)
0x00| 00 | . | flags: {}
0x00| 65 0a 08 61 | e..a | mtime: 1627916901
0x00| 00 | . | extra_flags: unknown (0)
0x00| 03 | . | os: Unix (3)
0x00| ab 56 4a 54 b2 52| .VJT.R| compressed: ab564a54b252303432aee50200
0x10|30 34 32 ae e5 02 00 |042.... |
0x10| 20 ac d2 9c | ... | crc32: Correct (9cd2ac20)
0x10| 0b 00 00 00| | ....|| isize: 11
$ fq tovalue /json.gz
{
"compressed": "<13>q1ZKVLJSMDQyruUCAA==",
"compression_method": 8,
"crc32": "<4>nNKsIA==",
"extra_flags": 0,
"flags": {
"comment": false,
"extra": false,
"header_crc": false,
"name": false,
"reserved": 0,
"text": false
},
"identification": "\u001f\ufffd",
"isize": 11,
"mtime": 1627916901,
"os": 3,
"uncompressed": {
"a": 123
}
}
$ fq .uncompressed /json.gz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0|7b 22 61 22 3a 20 31 32 33 7d |{"a": 123} |.uncompressed: {} (json)