Skip to content

Commit

Permalink
cover tarfs
Browse files Browse the repository at this point in the history
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
  • Loading branch information
Wwwsylvia committed Jan 21, 2025
1 parent 935cb1c commit f86c22b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/fs/tarfs/tarfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ func TestTarFS_Open_Success(t *testing.T) {
t.Fatalf("TarFS.Open(%s) error = %v, wantErr %v", name, err, nil)
}

fi, err := f.Stat()
if err != nil {
t.Fatalf("failed to get FileInfo for %s: %v", name, err)
}
if got, want := fi.Name(), filepath.Base(name); got != want {
t.Errorf("FileInfo.Name() = %v, want %v", got, want)
}

got, err := io.ReadAll(f)
if err != nil {
t.Fatalf("failed to read %s: %v", name, err)
Expand Down

0 comments on commit f86c22b

Please sign in to comment.