1
1
mirror of https://github.com/wader/fq.git synced 2024-11-24 11:16:09 +03:00
fq/pkg/interp/testdata/decode.fqtest
2022-02-05 17:24:42 +01:00

94 lines
6.5 KiB
Plaintext

$ fq -i -d mp3 . /test.mp3
mp3> decode
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers[0:1]:
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames[0:3]:
0x030|c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00|................|
* |until 0x283.7 (end) (599) | |
| | | footers[0:0]:
mp3> decode("mp3")
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers[0:1]:
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames[0:3]:
0x030|c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00|................|
* |until 0x283.7 (end) (599) | |
| | | footers[0:0]:
mp3> decode("mp3"; {})
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers[0:1]:
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames[0:3]:
0x030|c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00|................|
* |until 0x283.7 (end) (599) | |
| | | footers[0:0]:
mp3> probe
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers[0:1]:
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames[0:3]:
0x030|c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00|................|
* |until 0x283.7 (end) (599) | |
| | | footers[0:0]:
mp3> probe({})
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers[0:1]:
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames[0:3]:
0x030|c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00|................|
* |until 0x283.7 (end) (599) | |
| | | footers[0:0]:
mp3> format
"mp3"
mp3> null | format
null
mp3> ^D
$ fq -d raw 'png | d' /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: (png)
| | | error: png: RawLen(signature): failed at position 8 (read size 0 seek pos 0): failed to validate raw
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| unknown0: raw bits
* |until 0x283.7 (end) (644) | |
$ fq -d raw 'tobytes[0:1] | png | d' /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: (png)
| | | error: png: RawLen(signature): failed at position 0 (read size 0 seek pos 0): outside buffer
0x0|49 |I | unknown0: raw bits
$ fq -o force=true -d png d /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: /test.mp3 (png)
| | | error: png: BitBufRange: failed at position 0 (read size 2315363 seek pos 0): outside buffer
0x000|49 44 33 04 00 00 00 00 |ID3..... | signature: raw bits (invalid)
| | | chunks[0:1]:
| | | [0]{}:
0x000| 00 23 54 53 | .#TS | length: 2315347
0x000| 53 45 00 00| SE..| type: "SE\x00\x00"
0x000| 53 | S | ancillary: true
0x000| 45 | E | private: false
0x000| 00 | . | reserved: false
0x000| 00| .| safe_to_copy: false
0x010|00 0f 00 00 03 4c 61 76 66 35 38 2e 34 35 2e 31|.....Lavf58.45.1| unknown0: raw bits
* |until 0x283.7 (end) (628) | |
$ fq -d raw 'tobytes[0:1] | try probe catch . | type' /test.mp3
"array"
$ fq -d raw 'png({force: true}) | d' /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: (png)
| | | error: png: BitBufRange: failed at position 0 (read size 2315363 seek pos 0): outside buffer
0x000|49 44 33 04 00 00 00 00 |ID3..... | signature: raw bits (invalid)
| | | chunks[0:1]:
| | | [0]{}:
0x000| 00 23 54 53 | .#TS | length: 2315347
0x000| 53 45 00 00| SE..| type: "SE\x00\x00"
0x000| 53 | S | ancillary: true
0x000| 45 | E | private: false
0x000| 00 | . | reserved: false
0x000| 00| .| safe_to_copy: false
0x010|00 0f 00 00 03 4c 61 76 66 35 38 2e 34 35 2e 31|.....Lavf58.45.1| unknown0: raw bits
* |until 0x283.7 (end) (628) | |
$ fq -d bbb . /test.mp3
exitcode: 4
stderr:
error: /test.mp3: bbb: format group not found
$ fq -n '"aaa" | decode("aaa")'
exitcode: 5
stderr:
error: format group not found