feat: loader logic
This commit is contained in:
@@ -172,13 +172,28 @@ func TestRawFileCRUDAndList(t *testing.T) {
|
||||
t.Fatalf("write beta: %v", err)
|
||||
}
|
||||
|
||||
alphaExists, err := s.FileExists("nested/alpha.txt")
|
||||
alphaExists, alphaPath, err := s.FileExists("nested/alpha.txt")
|
||||
if err != nil {
|
||||
t.Fatalf("file exists: %v", err)
|
||||
}
|
||||
if !alphaExists {
|
||||
t.Fatal("nested/alpha.txt should exist")
|
||||
}
|
||||
wantAlphaPath := filepath.Join(s.storageRoot, "nested", "alpha.txt")
|
||||
if alphaPath != wantAlphaPath {
|
||||
t.Fatalf("file path = %q, want %q", alphaPath, wantAlphaPath)
|
||||
}
|
||||
|
||||
missingExists, missingPath, err := s.FileExists("missing.txt")
|
||||
if err != nil {
|
||||
t.Fatalf("missing file exists: %v", err)
|
||||
}
|
||||
if missingExists {
|
||||
t.Fatal("missing.txt should not exist")
|
||||
}
|
||||
if missingPath != "" {
|
||||
t.Fatalf("missing file path = %q, want empty string", missingPath)
|
||||
}
|
||||
|
||||
alphaData, err := s.ReadFile("nested/alpha.txt")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user