aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/vfs/unfold_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-29 21:51:31 +0900
committerOphestra <cat@gensokyo.uk>2025-08-29 21:51:31 +0900
commit50972096cd8bffd9b17dbdf656ec34c48edb8f86 (patch)
tree1ad00bbf65f59539aa9bd0b3e1f42b89b7ca3fcb /container/vfs/unfold_test.go
parent905b9f9785263297611a61facc8b6bdf4c3e257f (diff)
container/vfs: wrap decoder errors
This passes line information and handles strconv errors so it reads better. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/vfs/unfold_test.go')
-rw-r--r--container/vfs/unfold_test.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/container/vfs/unfold_test.go b/container/vfs/unfold_test.go
index cd6ace18..e04c51a5 100644
--- a/container/vfs/unfold_test.go
+++ b/container/vfs/unfold_test.go
@@ -1,11 +1,9 @@
package vfs_test
import (
- "errors"
"reflect"
"slices"
"strings"
- "syscall"
"testing"
"hakurei.app/container/vfs"
@@ -26,7 +24,7 @@ func TestUnfold(t *testing.T) {
"no match",
sampleMountinfoBase,
"/mnt",
- syscall.ESTALE, nil, nil, nil,
+ &vfs.DecoderError{Op: "unfold", Line: -1, Err: vfs.UnfoldTargetError("/mnt")}, nil, nil, nil,
},
{
"cover",
@@ -55,7 +53,7 @@ func TestUnfold(t *testing.T) {
d := vfs.NewMountInfoDecoder(strings.NewReader(tc.sample))
got, err := d.Unfold(tc.target)
- if !errors.Is(err, tc.wantErr) {
+ if !reflect.DeepEqual(err, tc.wantErr) {
t.Errorf("Unfold: error = %v, wantErr %v",
err, tc.wantErr)
}