container: use more reliable nonexistence
All checks were successful
Test / Create distribution (push) Successful in 45s
Test / Sandbox (push) Successful in 2m21s
Test / Hakurei (push) Successful in 3m8s
Test / Planterette (push) Successful in 3m55s
Test / Sandbox (race detector) (push) Successful in 4m6s
Test / Hakurei (race detector) (push) Successful in 4m41s
Test / Flake checks (push) Successful in 1m18s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-07-18 23:18:26 +09:00
parent 6ba19a7ba5
commit 9d7a19d162
6 changed files with 24 additions and 14 deletions

View File

@@ -3,6 +3,8 @@ package system
import (
"os"
"testing"
"hakurei.app/container"
)
func TestEnsure(t *testing.T) {
@@ -60,11 +62,11 @@ func TestMkdirString(t *testing.T) {
t.Run(tc.want, func(t *testing.T) {
m := &Mkdir{
et: tc.et,
path: "/nonexistent",
path: container.Nonexistent,
perm: 0701,
ephemeral: tc.ephemeral,
}
want := "mode: " + os.FileMode(0701).String() + " type: " + tc.want + " path: \"/nonexistent\""
want := "mode: " + os.FileMode(0701).String() + " type: " + tc.want + ` path: "/proc/nonexistent"`
if got := m.String(); got != want {
t.Errorf("String() = %v, want %v", got, want)
}