diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-01-03 20:56:11 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-01-03 20:56:11 +0900 |
| commit | deda16da38187091ec59d28fb4fbc672ff71e70e (patch) | |
| tree | bee9667be77586bb6ab4850b2a1f05d5e836f6e1 /internal/pkg/dir_test.go | |
| parent | 55465c6e72a1ca0a1d7fc719ca73d18531e911fe (diff) | |
internal/pkg: create work directory
This is used for artifacts that cure into directories.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/dir_test.go')
| -rw-r--r-- | internal/pkg/dir_test.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/internal/pkg/dir_test.go b/internal/pkg/dir_test.go index 97660279..fe3daa36 100644 --- a/internal/pkg/dir_test.go +++ b/internal/pkg/dir_test.go @@ -23,11 +23,13 @@ func TestFlatten(t *testing.T) { ".": {Mode: 020000000700}, "checksum": {Mode: 020000000700}, "identifier": {Mode: 020000000700}, + "work": {Mode: 020000000700}, }, []pkg.FlatEntry{ {Mode: 020000000700, Path: "."}, {Mode: 020000000700, Path: "checksum"}, {Mode: 020000000700, Path: "identifier"}, - }, pkg.MustDecode("ANVz3GwS4oTcFTOjbc-n_N6MtycCtkELMBJB0ohuRz02PtmWZEJF8v3I51DtM0CY")}, + {Mode: 020000000700, Path: "work"}, + }, pkg.MustDecode("E4vEZKhCcL2gPZ2Tt59FS3lDng-d_2SKa2i5G_RbDfwGn6EemptFaGLPUDiOa94C")}, {"sample cache file", fstest.MapFS{ ".": {Mode: 020000000700}, @@ -41,6 +43,8 @@ func TestFlatten(t *testing.T) { "identifier/0bSFPu5Tnd-2Jj0Mv6co23PW2t3BmHc7eLFj9TgY3eIBg8zislo7xZYNBqovVLcq": {Mode: 0400, Data: []byte{0, 0, 0, 0, 0xad, 0xb, 0, 4, 0xfe, 0xfe, 0, 0, 0xfe, 0xca, 0, 0}}, "identifier/cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafebabe": {Mode: 0400, Data: []byte{0, 0, 0, 0, 0xad, 0xb, 0, 4, 0xfe, 0xfe, 0, 0, 0xfe, 0xca, 0, 0}}, "identifier/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef": {Mode: 0400, Data: []byte{0, 0, 0, 0, 0xad, 0xb, 0, 4, 0xfe, 0xfe, 0, 0, 0xfe, 0xca, 0, 0}}, + + "work": {Mode: 020000000700}, }, []pkg.FlatEntry{ {Mode: 020000000700, Path: "."}, @@ -53,7 +57,9 @@ func TestFlatten(t *testing.T) { {Mode: 0400, Path: "identifier/cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafebabe", Data: []byte{0, 0, 0, 0, 0xad, 0xb, 0, 4, 0xfe, 0xfe, 0, 0, 0xfe, 0xca, 0, 0}}, {Mode: 0400, Path: "identifier/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", Data: []byte{0, 0, 0, 0, 0xad, 0xb, 0, 4, 0xfe, 0xfe, 0, 0, 0xfe, 0xca, 0, 0}}, {Mode: 0400, Path: "identifier/vsAhtPNo4waRNOASwrQwcIPTqb3SBuJOXw2G4T1mNmVZM-wrQTRllmgXqcIIoRcX", Data: []byte{0}}, - }, pkg.MustDecode("ZNSQH-mjhtIbFvi51lQ0UjatjoS8_5ILrBPNWlO2LWTq9P6MJEnekYzP0esUJnVr")}, + + {Mode: 020000000700, Path: "work"}, + }, pkg.MustDecode("G4u4W77C3u46oSAzwPTERKbS9h76iIvcd7Zl8p8Y6hTMb4_QGpH0Glg_DIJg-Usa")}, {"sample load or store", fstest.MapFS{ ".": {Mode: 020000000700}, @@ -63,6 +69,8 @@ func TestFlatten(t *testing.T) { "identifier": {Mode: 020000000700}, "identifier/fLYGIMHgN1louE-JzITJZJo2SDniPu-IHBXubtvQWFO-hXnDVKNuscV7-zlyr5fU": {Mode: 0400, Data: []byte("\x7f\xe1\x69\xa2\xdd\x63\x96\x26\x83\x79\x61\x8b\xf0\x3f\xd5\x16\x9a\x39\x3a\xdb\xcf\xb1\xbc\x8d\x33\xff\x75\xee\x62\x56\xa9\xf0\x27\xac\x13\x94\x69")}, + + "work": {Mode: 020000000700}, }, []pkg.FlatEntry{ {Mode: 020000000700, Path: "."}, @@ -71,7 +79,9 @@ func TestFlatten(t *testing.T) { {Mode: 020000000700, Path: "identifier"}, {Mode: 0400, Path: "identifier/fLYGIMHgN1louE-JzITJZJo2SDniPu-IHBXubtvQWFO-hXnDVKNuscV7-zlyr5fU", Data: []byte("\x7f\xe1\x69\xa2\xdd\x63\x96\x26\x83\x79\x61\x8b\xf0\x3f\xd5\x16\x9a\x39\x3a\xdb\xcf\xb1\xbc\x8d\x33\xff\x75\xee\x62\x56\xa9\xf0\x27\xac\x13\x94\x69")}, - }, pkg.MustDecode("5ns3Ky8-n_pETpwO3UYA88FKKLins6kxtgRQBEfSiGIpZXu6QCBOW2ukm-nWnUwC")}, + + {Mode: 020000000700, Path: "work"}, + }, pkg.MustDecode("bAJdeuI2cITlff5uIDbMKIiaW6zB-_XGinOMOMjNmltL3YAanXLiV64_jsXeQMXn")}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { |
