Skip to content

Commit

Permalink
format,interp: Use MustGroup and add probe order test
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Sep 28, 2021
1 parent 8a4f66f commit aa38ccf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions format/all/all.fqtest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$ fq -n _registry.groups.probe
[
"adts",
"bzip2",
"elf",
"flac",
"gif",
"gzip",
"jpeg",
"matroska",
"mp4",
"ogg",
"png",
"tar",
"tiff",
"webp",
"mpeg_ts",
"wav",
"mp3",
"json"
]
4 changes: 2 additions & 2 deletions pkg/interp/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ func (i *Interp) _registry(c interface{}, a []interface{}) interface{} {
groups := map[string]interface{}{}
formats := map[string]interface{}{}

for fsName, fs := range i.registry.Groups {
for fsName := range i.registry.Groups {
var group []interface{}

for _, f := range fs {
for _, f := range i.registry.MustGroup(fsName) {
group = append(group, f.Name)
if _, ok := uniqueFormats[f.Name]; ok {
continue
Expand Down

0 comments on commit aa38ccf

Please sign in to comment.