Skip to content

Commit

Permalink
interp: Use todescription in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Nov 19, 2021
1 parent 07b4210 commit 9cba69e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions pkg/interp/testdata/inputs.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@ a
b
/c:
c
$ fq -d raw ._description /a /b /c
$ fq -d raw todescription /a /b /c
"/a"
"/b"
"/c"
$ fq -d raw (.,inputs)._description /a /b /c
$ fq -d raw '(.,inputs) | todescription' /a /b /c
"/a"
"/b"
"/c"
$ fq -d raw (.,input,input,input)._description /a /b /c
$ fq -d raw '(.,input,input,input) | try todescription catch .' /a /b /c
"/a"
"/b"
"/c"
exitcode: 5
stderr:
error: break
$ fq -d raw -n (.,inputs)._description /a /b /c
null
$ fq -d raw -n '(.,inputs) | try todescription catch .' /a /b /c
"expected a decode value but got: null (null)"
"/a"
"/b"
"/c"
$ fq -d raw -n inputs._description /a /b /c
$ fq -d raw -n 'inputs | try todescription catch .' /a /b /c
"/a"
"/b"
"/c"
$ fq -d raw -n '[inputs._description]' /a /b /c
$ fq -d raw -n '[inputs | try todescription catch .]' /a /b /c
[
"/a",
"/b",
"/c"
]
$ fq -d raw -n (input,input,input,input)._description /a /b /c
$ fq -d raw -n '(input,input,input,input) | todescription' /a /b /c
"/a"
"/b"
"/c"
Expand Down Expand Up @@ -65,7 +65,7 @@ stderr:
error: cannot add: number (1) and string ("a")
error: cannot add: number (1) and string ("a")
error: cannot add: number (1) and string ("a")
$ fq -s -d raw [.[]._description] /a /b /c
$ fq -s -d raw '[.[] | todescription]' /a /b /c
[
"/a",
"/b",
Expand Down
2 changes: 1 addition & 1 deletion pkg/interp/testdata/value.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ mp3> ._parent
null
mp3> ._sym
null
mp3> ._description
mp3> todescription
"/test.mp3"
mp3> topath
[]
Expand Down

0 comments on commit 9cba69e

Please sign in to comment.