internal/pkg: improve output measuring

This significantly improves readability and maintainability.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-06 03:41:04 +09:00
parent 617ee21647
commit dfd26abf6c
7 changed files with 469 additions and 617 deletions

View File

@@ -3,6 +3,7 @@ package pkg_test
import (
"bytes"
"io"
"io/fs"
"reflect"
"testing"
@@ -105,9 +106,12 @@ func TestIRRoundtrip(t *testing.T) {
if err := <-done; err != nil {
t.Fatalf("EncodeAll: error = %v", err)
}
}, pkg.MustDecode(
"E4vEZKhCcL2gPZ2Tt59FS3lDng-d_2SKa2i5G_RbDfwGn6EemptFaGLPUDiOa94C",
),
}, expectsFS{
".": {Mode: fs.ModeDir | 0700},
"checksum": {Mode: fs.ModeDir | 0700},
"identifier": {Mode: fs.ModeDir | 0700},
"work": {Mode: fs.ModeDir | 0700},
},
}
}
checkWithCache(t, testCasesCache)