1
1
mirror of https://github.com/wader/fq.git synced 2024-12-23 21:31:33 +03:00

format,interp: Use MustGroup and add probe order test

This commit is contained in:
Mattias Wadman 2021-09-28 13:08:22 +02:00
parent 8a4f66f616
commit aa38ccf0e1
2 changed files with 23 additions and 2 deletions

21
format/all/all.fqtest Normal file
View File

@ -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"
]

View File

@ -395,10 +395,10 @@ func (i *Interp) _registry(c interface{}, a []interface{}) interface{} {
groups := map[string]interface{}{} groups := map[string]interface{}{}
formats := map[string]interface{}{} formats := map[string]interface{}{}
for fsName, fs := range i.registry.Groups { for fsName := range i.registry.Groups {
var group []interface{} var group []interface{}
for _, f := range fs { for _, f := range i.registry.MustGroup(fsName) {
group = append(group, f.Name) group = append(group, f.Name)
if _, ok := uniqueFormats[f.Name]; ok { if _, ok := uniqueFormats[f.Name]; ok {
continue continue