aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/file_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-07 00:39:29 +0900
committerOphestra <cat@gensokyo.uk>2026-01-07 00:39:29 +0900
commit3a21ba1bcadd33a32a011329362d901374716626 (patch)
treee1b840ad264f60d728d097a5ef7cb82934986838 /internal/pkg/file_test.go
parent45301559bf4df313fef6894ec900e8a618339a79 (diff)
internal/pkg: implement file artifact
This is an Artifact implementing File, backed by a constant, caller-supplied byte slice. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/file_test.go')
-rw-r--r--internal/pkg/file_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/internal/pkg/file_test.go b/internal/pkg/file_test.go
new file mode 100644
index 00000000..48e55624
--- /dev/null
+++ b/internal/pkg/file_test.go
@@ -0,0 +1,29 @@
+package pkg_test
+
+import (
+ "testing"
+
+ "hakurei.app/container/check"
+ "hakurei.app/internal/pkg"
+)
+
+func TestFile(t *testing.T) {
+ t.Parallel()
+
+ checkWithCache(t, []cacheTestCase{
+ {"file", nil, func(t *testing.T, base *check.Absolute, c *pkg.Cache) {
+ c.SetStrict(true)
+
+ cureMany(t, c, []cureStep{
+ {"short", pkg.NewFile([]byte{0}), base.Append(
+ "identifier",
+ "lIx_W4M7tVOcQ8jh08EJOfXf4brRmkEEjvUa7c17vVUzlmtUxlhhrgqmc9aZhjbn",
+ ), pkg.MustDecode(
+ "vsAhtPNo4waRNOASwrQwcIPTqb3SBuJOXw2G4T1mNmVZM-wrQTRllmgXqcIIoRcX",
+ ), nil},
+ })
+ }, pkg.MustDecode(
+ "hnrfmJtivNKcgtETsKnU9gP_OwPgpNY3DSUJnmxnmeOODSO-YBvEBiTgieY4AAd7",
+ )},
+ })
+}