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:
Ophestra 2025-07-20 04:12:26 +09:00
parent 55933ccfb3
commit 66a4079114
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
34 changed files with 64 additions and 3276021 deletions

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
testdata/format/stdin_getchoo_atlas.gz vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
testdata/format/stdin_getchoo_glados.gz vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

37432
testdata/getchoo_atlas vendored

File diff suppressed because it is too large Load Diff

BIN
testdata/getchoo_atlas.gz vendored Normal file

Binary file not shown.

84832
testdata/getchoo_glados vendored

File diff suppressed because it is too large Load Diff

BIN
testdata/getchoo_glados.gz vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
testdata/instantiated/getchoo_atlas.gz vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
testdata/instantiated/getchoo_glados.gz vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
testdata/pluiedev_pappardelle.gz vendored Normal file

Binary file not shown.