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:
@@ -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
|
||||
)
|
||||
|
||||
+19
-2
@@ -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
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
-25109
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
-24847
File diff suppressed because it is too large
Load Diff
Binary file not shown.
-638437
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
-1109317
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
-1139733
File diff suppressed because one or more lines are too long
Binary file not shown.
Vendored
-15013
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
Vendored
-25109
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
-24847
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
Vendored
-37432
File diff suppressed because it is too large
Load Diff
Vendored
BIN
Binary file not shown.
Vendored
-84832
File diff suppressed because it is too large
Load Diff
Vendored
BIN
Binary file not shown.
Vendored
-6279
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
Vendored
-10730
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
-10686
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
Vendored
-108599
File diff suppressed because it is too large
Load Diff
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user