mirror of
https://github.com/wader/fq.git
synced 2024-09-20 08:18:51 +03:00
Merge pull request #131 from wader/interp-tovalue-default-opts
interp: Add missing default opts for tovalue
This commit is contained in:
commit
1d34cbd5e7
@ -49,7 +49,7 @@ def decode: decode(options.decode_format; {});
|
||||
|
||||
def topath: _decode_value(._path);
|
||||
def tovalue($opts): _tovalue(options($opts));
|
||||
def tovalue: _tovalue({});
|
||||
def tovalue: _tovalue(options({}));
|
||||
def toactual: _decode_value(._actual);
|
||||
def tosym: _decode_value(._sym);
|
||||
def todescription: _decode_value(._description);
|
||||
|
5
pkg/interp/testdata/tovalue.fqtest
vendored
Normal file
5
pkg/interp/testdata/tovalue.fqtest
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
$ fq -i
|
||||
null> "aaa" | raw | .unknown0 | tovalue, tovalue({sizebase: 2})
|
||||
"<3>YWFh"
|
||||
"<0b11>YWFh"
|
||||
null> ^D
|
2
pkg/interp/testdata/value_null.fqtest
vendored
2
pkg/interp/testdata/value_null.fqtest
vendored
@ -2,7 +2,7 @@ $ fq -i -d mp3 . /test.mp3
|
||||
mp3> .headers[0].padding | ., tovalue, type, length?
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
||||
0x20| 00 00 00 00 00 00 00 00 00 00 | .......... |.headers[0].padding: raw bits (all zero)
|
||||
"<0b1010>AAAAAAAAAAAAAA=="
|
||||
"<10>AAAAAAAAAAAAAA=="
|
||||
"string"
|
||||
10
|
||||
mp3> .headers[0].padding[0] | ., type, length?
|
||||
|
Loading…
Reference in New Issue
Block a user