-// Copyright (C) 2021 Simon Ruderich
+// Copyright (C) 2021-2022 Simon Ruderich
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
if err != nil {
t.Fatal(err)
}
- defer os.Chdir(cwd)
+ defer os.Chdir(cwd) //nolint:errcheck
err = os.RemoveAll("testdata")
if err != nil {
}
_, uid, _, gid := ft.CurrentUserAndGroup()
- symlinkExists := "open file: too many levels of symbolic links"
+ symlinkExists := "\"file\": too many levels of symbolic links"
if runtime.GOOS == "freebsd" {
// EMLINK instead of ELOOP
- symlinkExists = "open file: too many links"
+ symlinkExists = "\"file\": too many links"
}
tests := []struct {
nil,
[]ft.File{
root,
- ft.File{
+ {
Path: "file",
Mode: 0640,
Data: []byte("line\n"),
},
[]ft.File{
root,
- ft.File{
+ {
Path: "file",
Mode: 0641,
Data: []byte("line\n"),
},
[]ft.File{
root,
- ft.File{
+ {
Path: "file",
Mode: 0641,
Data: []byte("existing\nline\n"),
},
[]ft.File{
root,
- ft.File{
+ {
Path: "file",
Mode: 0641,
Data: []byte("existing\nline\n"),
},
[]ft.File{
root,
- ft.File{
+ {
Path: "file",
Mode: 0641,
Data: []byte("first\nline\n"),
},
[]ft.File{
root,
- ft.File{
+ {
Path: "file",
Mode: 0641,
Data: []byte("first\nline\n"),
},
[]ft.File{
root,
- ft.File{
+ {
Path: "file",
Mode: 0641,
Data: []byte("# line with spaces\nline with spaces\n"),
},
[]ft.File{
root,
- ft.File{
+ {
Path: "file",
Mode: fs.ModeSymlink | 0777,
Data: []byte("target"),
},
[]ft.File{
root,
- ft.File{
+ {
Path: "file",
Mode: fs.ModeNamedPipe | 0640,
},
},
nil,
- fmt.Errorf("\"file\" is not a regular file but p---------"),
+ fmt.Errorf("\"file\": not a regular file but p---------"),
},
}