treewide: compress testdata
This significantly improves handling by reducing file size. This is also part of an effort of getting this to build on nix itself.
This commit is contained in:
parent
55933ccfb3
commit
66a4079114
@ -5,20 +5,23 @@ import _ "embed"
|
||||
// github:getchoo/borealis#atlas
|
||||
|
||||
var (
|
||||
//go:embed testdata/getchoo_atlas
|
||||
getchooAtlasOut string
|
||||
getchooAtlasOut = string(sampleMustGunzip(getchooAtlasOutGzip))
|
||||
//go:embed testdata/getchoo_atlas.gz
|
||||
getchooAtlasOutGzip []byte
|
||||
|
||||
getchooAtlasInstantiated = sampleSplitPaths(getchooAtlasInstantiatedRaw)
|
||||
//go:embed testdata/instantiated/getchoo_atlas
|
||||
getchooAtlasInstantiatedRaw string
|
||||
getchooAtlasInstantiated = sampleSplitPaths(sampleMustGunzip(getchooAtlasInstantiatedGzip))
|
||||
//go:embed testdata/instantiated/getchoo_atlas.gz
|
||||
getchooAtlasInstantiatedGzip []byte
|
||||
|
||||
//go:embed testdata/derivation/show_getchoo_atlas.json
|
||||
getchooAtlasShow []byte
|
||||
getchooAtlasShow = sampleMustGunzip(getchooAtlasShowGzip)
|
||||
//go:embed testdata/derivation/show_getchoo_atlas.json.gz
|
||||
getchooAtlasShowGzip []byte
|
||||
|
||||
getchooAtlasCollective = sampleSplitPaths(getchooAtlasCollectiveRaw)
|
||||
//go:embed testdata/derivation/collect_getchoo_atlas
|
||||
getchooAtlasCollectiveRaw string
|
||||
getchooAtlasCollective = sampleSplitPaths(sampleMustGunzip(getchooAtlasCollectiveGzip))
|
||||
//go:embed testdata/derivation/collect_getchoo_atlas.gz
|
||||
getchooAtlasCollectiveGzip []byte
|
||||
|
||||
//go:embed testdata/format/stdin_getchoo_atlas
|
||||
getchooAtlasStdin string
|
||||
getchooAtlasStdin = string(sampleMustGunzip(getchooAtlasStdinGzip))
|
||||
//go:embed testdata/format/stdin_getchoo_atlas.gz
|
||||
getchooAtlasStdinGzip []byte
|
||||
)
|
||||
|
@ -5,20 +5,23 @@ import _ "embed"
|
||||
// github:getchoo/borealis#glados
|
||||
|
||||
var (
|
||||
//go:embed testdata/getchoo_glados
|
||||
getchooGladosOut string
|
||||
getchooGladosOut = string(sampleMustGunzip(getchooGladosOutGzip))
|
||||
//go:embed testdata/getchoo_glados.gz
|
||||
getchooGladosOutGzip []byte
|
||||
|
||||
getchooGladosInstantiated = sampleSplitPaths(getchooGladosInstantiatedRaw)
|
||||
//go:embed testdata/instantiated/getchoo_glados
|
||||
getchooGladosInstantiatedRaw string
|
||||
getchooGladosInstantiated = sampleSplitPaths(sampleMustGunzip(getchooGladosInstantiatedGzip))
|
||||
//go:embed testdata/instantiated/getchoo_glados.gz
|
||||
getchooGladosInstantiatedGzip []byte
|
||||
|
||||
//go:embed testdata/derivation/show_getchoo_glados.json
|
||||
getchooGladosShow []byte
|
||||
getchooGladosShow = sampleMustGunzip(getchooGladosShowGzip)
|
||||
//go:embed testdata/derivation/show_getchoo_glados.json.gz
|
||||
getchooGladosShowGzip []byte
|
||||
|
||||
getchooGladosCollective = sampleSplitPaths(getchooGladosCollectiveRaw)
|
||||
//go:embed testdata/derivation/collect_getchoo_glados
|
||||
getchooGladosCollectiveRaw string
|
||||
getchooGladosCollective = sampleSplitPaths(sampleMustGunzip(getchooGladosCollectiveGzip))
|
||||
//go:embed testdata/derivation/collect_getchoo_glados.gz
|
||||
getchooGladosCollectiveGzip []byte
|
||||
|
||||
//go:embed testdata/format/stdin_getchoo_glados
|
||||
getchooGladosStdin string
|
||||
getchooGladosStdin = string(sampleMustGunzip(getchooGladosStdinGzip))
|
||||
//go:embed testdata/format/stdin_getchoo_glados.gz
|
||||
getchooGladosStdinGzip []byte
|
||||
)
|
||||
|
@ -7,20 +7,23 @@ import (
|
||||
// git+https://tangled.sh/@pluie.me/flake#pappardelle
|
||||
|
||||
var (
|
||||
//go:embed testdata/pluiedev_pappardelle
|
||||
pluiedevPappardelleOut string
|
||||
pluiedevPappardelleOut = string(sampleMustGunzip(pluiedevPappardelleGzip))
|
||||
//go:embed testdata/pluiedev_pappardelle.gz
|
||||
pluiedevPappardelleGzip []byte
|
||||
|
||||
pluiedevPappardelleInstantiated = sampleSplitPaths(pluiedevPappardelleInstantiatedRaw)
|
||||
//go:embed testdata/instantiated/pluiedev_pappardelle
|
||||
pluiedevPappardelleInstantiatedRaw string
|
||||
pluiedevPappardelleInstantiated = sampleSplitPaths(sampleMustGunzip(pluiedevPappardelleInstantiatedGzip))
|
||||
//go:embed testdata/instantiated/pluiedev_pappardelle.gz
|
||||
pluiedevPappardelleInstantiatedGzip []byte
|
||||
|
||||
//go:embed testdata/derivation/show_pluiedev_pappardelle.json
|
||||
pluiedevPappardelleShow []byte
|
||||
pluiedevPappardelleShow = sampleMustGunzip(pluiedevPappardelleShowGzip)
|
||||
//go:embed testdata/derivation/show_pluiedev_pappardelle.json.gz
|
||||
pluiedevPappardelleShowGzip []byte
|
||||
|
||||
pluiedevPappardelleCollective = sampleSplitPaths(pluiedevPappardelleCollectiveRaw)
|
||||
//go:embed testdata/derivation/collect_pluiedev_pappardelle
|
||||
pluiedevPappardelleCollectiveRaw string
|
||||
pluiedevPappardelleCollective = sampleSplitPaths(sampleMustGunzip(pluiedevPappardelleCollectiveGzip))
|
||||
//go:embed testdata/derivation/collect_pluiedev_pappardelle.gz
|
||||
pluiedevPappardelleCollectiveGzip []byte
|
||||
|
||||
//go:embed testdata/format/stdin_pluiedev_pappardelle
|
||||
pluiedevPappardelleStdin string
|
||||
pluiedevPappardelleStdin = string(sampleMustGunzip(pluiedevPappardelleStdinGzip))
|
||||
//go:embed testdata/format/stdin_pluiedev_pappardelle.gz
|
||||
pluiedevPappardelleStdinGzip []byte
|
||||
)
|
||||
|
@ -1,6 +1,11 @@
|
||||
package nix_test
|
||||
|
||||
import "strings"
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"io"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var instSample = map[string]string{
|
||||
"bad fields": segmentPrefix + `instantiated 'config.sub-948ae97' ` + segmentSuffix,
|
||||
@ -62,4 +67,16 @@ source path '/nix/store/vdzlppvrdkz9rv14q4j02g9kpjbww2ww-source/pkgs/build-suppo
|
||||
copying '/nix/store/vdzlppvrdkz9rv14q4j02g9kpjbww2ww-source/pkgs/build-support/bintools-wrapper/ld-wrapper.sh' to the store...`
|
||||
)
|
||||
|
||||
func sampleSplitPaths(s string) []string { return strings.Split(strings.TrimSpace(s), "\n") }
|
||||
func sampleSplitPaths(data []byte) []string {
|
||||
return strings.Split(strings.TrimSpace(string(data)), "\n")
|
||||
}
|
||||
|
||||
func sampleMustGunzip(data []byte) []byte {
|
||||
var u []byte
|
||||
if r, err := gzip.NewReader(bytes.NewReader(data)); err != nil {
|
||||
panic(err.Error())
|
||||
} else if u, err = io.ReadAll(r); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
return u
|
||||
}
|
||||
|
15013
testdata/derivation/collect_getchoo_atlas
vendored
15013
testdata/derivation/collect_getchoo_atlas
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/derivation/collect_getchoo_atlas.gz
vendored
Normal file
BIN
testdata/derivation/collect_getchoo_atlas.gz
vendored
Normal file
Binary file not shown.
25109
testdata/derivation/collect_getchoo_glados
vendored
25109
testdata/derivation/collect_getchoo_glados
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/derivation/collect_getchoo_glados.gz
vendored
Normal file
BIN
testdata/derivation/collect_getchoo_glados.gz
vendored
Normal file
Binary file not shown.
24847
testdata/derivation/collect_pluiedev_pappardelle
vendored
24847
testdata/derivation/collect_pluiedev_pappardelle
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/derivation/collect_pluiedev_pappardelle.gz
vendored
Normal file
BIN
testdata/derivation/collect_pluiedev_pappardelle.gz
vendored
Normal file
Binary file not shown.
638437
testdata/derivation/show_getchoo_atlas.json
vendored
638437
testdata/derivation/show_getchoo_atlas.json
vendored
File diff suppressed because one or more lines are too long
BIN
testdata/derivation/show_getchoo_atlas.json.gz
vendored
Normal file
BIN
testdata/derivation/show_getchoo_atlas.json.gz
vendored
Normal file
Binary file not shown.
1109317
testdata/derivation/show_getchoo_glados.json
vendored
1109317
testdata/derivation/show_getchoo_glados.json
vendored
File diff suppressed because one or more lines are too long
BIN
testdata/derivation/show_getchoo_glados.json.gz
vendored
Normal file
BIN
testdata/derivation/show_getchoo_glados.json.gz
vendored
Normal file
Binary file not shown.
1139733
testdata/derivation/show_pluiedev_pappardelle.json
vendored
1139733
testdata/derivation/show_pluiedev_pappardelle.json
vendored
File diff suppressed because one or more lines are too long
BIN
testdata/derivation/show_pluiedev_pappardelle.json.gz
vendored
Normal file
BIN
testdata/derivation/show_pluiedev_pappardelle.json.gz
vendored
Normal file
Binary file not shown.
15013
testdata/format/stdin_getchoo_atlas
vendored
15013
testdata/format/stdin_getchoo_atlas
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/format/stdin_getchoo_atlas.gz
vendored
Normal file
BIN
testdata/format/stdin_getchoo_atlas.gz
vendored
Normal file
Binary file not shown.
25109
testdata/format/stdin_getchoo_glados
vendored
25109
testdata/format/stdin_getchoo_glados
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/format/stdin_getchoo_glados.gz
vendored
Normal file
BIN
testdata/format/stdin_getchoo_glados.gz
vendored
Normal file
Binary file not shown.
24847
testdata/format/stdin_pluiedev_pappardelle
vendored
24847
testdata/format/stdin_pluiedev_pappardelle
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/format/stdin_pluiedev_pappardelle.gz
vendored
Normal file
BIN
testdata/format/stdin_pluiedev_pappardelle.gz
vendored
Normal file
Binary file not shown.
37432
testdata/getchoo_atlas
vendored
37432
testdata/getchoo_atlas
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/getchoo_atlas.gz
vendored
Normal file
BIN
testdata/getchoo_atlas.gz
vendored
Normal file
Binary file not shown.
84832
testdata/getchoo_glados
vendored
84832
testdata/getchoo_glados
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/getchoo_glados.gz
vendored
Normal file
BIN
testdata/getchoo_glados.gz
vendored
Normal file
Binary file not shown.
6279
testdata/instantiated/getchoo_atlas
vendored
6279
testdata/instantiated/getchoo_atlas
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/instantiated/getchoo_atlas.gz
vendored
Normal file
BIN
testdata/instantiated/getchoo_atlas.gz
vendored
Normal file
Binary file not shown.
10730
testdata/instantiated/getchoo_glados
vendored
10730
testdata/instantiated/getchoo_glados
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/instantiated/getchoo_glados.gz
vendored
Normal file
BIN
testdata/instantiated/getchoo_glados.gz
vendored
Normal file
Binary file not shown.
10686
testdata/instantiated/pluiedev_pappardelle
vendored
10686
testdata/instantiated/pluiedev_pappardelle
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/instantiated/pluiedev_pappardelle.gz
vendored
Normal file
BIN
testdata/instantiated/pluiedev_pappardelle.gz
vendored
Normal file
Binary file not shown.
108599
testdata/pluiedev_pappardelle
vendored
108599
testdata/pluiedev_pappardelle
vendored
File diff suppressed because it is too large
Load Diff
BIN
testdata/pluiedev_pappardelle.gz
vendored
Normal file
BIN
testdata/pluiedev_pappardelle.gz
vendored
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user