diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-25 22:52:48 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-25 22:52:48 +0900 |
| commit | c328b584c0449e846f8d49976df65fce657c2a67 (patch) | |
| tree | a10fa3d86bd814d7f299836b0032ec6b5bd89cd0 /hst/fslink_test.go | |
| parent | 9585b35d5b4e91bb327e3eddb229d1b711eeec2f (diff) | |
hst/fslink: improve string representation
This shortens the representation of most common use cases and generally improves readability.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/fslink_test.go')
| -rw-r--r-- | hst/fslink_test.go | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/hst/fslink_test.go b/hst/fslink_test.go index c8583544..b3e196e6 100644 --- a/hst/fslink_test.go +++ b/hst/fslink_test.go @@ -12,7 +12,20 @@ func TestFSLink(t *testing.T) { {"nil", (*hst.FSLink)(nil), false, nil, nil, nil, "<invalid>"}, {"zero", new(hst.FSLink), false, nil, nil, nil, "<invalid>"}, - {"deref rel", &hst.FSLink{Target: m("/"), Linkname: ":3", Dereference: true}, false, nil, nil, nil, "<invalid>"}, + {"deref rel", &hst.FSLink{Target: m("/"), Linkname: ":3", Dereference: true}, + false, nil, nil, nil, "<invalid>"}, + {"deref differs", &hst.FSLink{ + Target: m("/.hakurei/etc"), + Linkname: "/etc/static", + Dereference: true, + }, true, container.Ops{ + &container.SymlinkOp{ + Target: m("/.hakurei/etc"), + LinkName: "/etc/static", + Dereference: true, + }, + }, m("/.hakurei/etc"), nil, + "/.hakurei/etc -> */etc/static"}, {"deref", &hst.FSLink{ Target: m("/run/current-system"), Linkname: "/run/current-system", @@ -24,7 +37,7 @@ func TestFSLink(t *testing.T) { Dereference: true, }, }, m("/run/current-system"), nil, - "&/run/current-system:*/run/current-system"}, + "/run/current-system@"}, {"direct", &hst.FSLink{ Target: m("/etc/mtab"), @@ -34,7 +47,7 @@ func TestFSLink(t *testing.T) { Target: m("/etc/mtab"), LinkName: "/proc/mounts", }, - }, m("/etc/mtab"), nil, "&/etc/mtab:/proc/mounts"}, + }, m("/etc/mtab"), nil, "/etc/mtab -> /proc/mounts"}, {"direct rel", &hst.FSLink{ Target: m("/etc/mtab"), @@ -44,6 +57,6 @@ func TestFSLink(t *testing.T) { Target: m("/etc/mtab"), LinkName: "../proc/mounts", }, - }, m("/etc/mtab"), nil, "&/etc/mtab:../proc/mounts"}, + }, m("/etc/mtab"), nil, "/etc/mtab -> ../proc/mounts"}, }) } |
