add proper constants for node type

This commit is contained in:
Michael Eischer 2024-07-09 19:51:44 +02:00
parent 3b438e5c7c
commit ca1e5e10b6
42 changed files with 206 additions and 206 deletions

View file

@ -42,7 +42,7 @@ func checkFile(t testing.TB, stat *syscall.Stat_t, node *restic.Node) {
t.Errorf("Dev does not match, want %v, got %v", stat.Dev, node.DeviceID)
}
if node.Size != uint64(stat.Size) && node.Type != "symlink" {
if node.Size != uint64(stat.Size) && node.Type != restic.NodeTypeSymlink {
t.Errorf("Size does not match, want %v, got %v", stat.Size, node.Size)
}
@ -135,9 +135,9 @@ func TestNodeFromFileInfo(t *testing.T) {
}
switch node.Type {
case "file", "symlink":
case restic.NodeTypeFile, restic.NodeTypeSymlink:
checkFile(t, s, node)
case "dev", "chardev":
case restic.NodeTypeDev, restic.NodeTypeCharDev:
checkFile(t, s, node)
checkDevice(t, s, node)
default: