MMap.Name() should return the SHM name not the full filesystem path

This commit is contained in:
Kovid Goyal
2022-12-22 11:36:11 +05:30
parent 6ace082bc2
commit 2d1a2c30bf
3 changed files with 12 additions and 5 deletions

View File

@@ -48,8 +48,8 @@ func TestSHM(t *testing.T) {
if err == nil {
t.Fatalf("Unlinking failed could re-open the SHM data. Data equal: %v Data length: %d", reflect.DeepEqual(g.Slice(), data), len(g.Slice()))
}
if mm.IsFilesystemBacked() {
_, err = os.Stat(mm.Name())
if mm.IsFileSystemBacked() {
_, err = os.Stat(mm.FileSystemName())
if !errors.Is(err, fs.ErrNotExist) {
t.Fatalf("Unlinking %s did not work", mm.Name())
}