Skip to content

Commit

Permalink
Fix minor cleanup bug in non existent runtime directory test case
Browse files Browse the repository at this point in the history
  • Loading branch information
adrg committed Nov 2, 2024
1 parent aa865a5 commit b92dacd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xdg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ func TestNonExistentRuntimeDir(t *testing.T) {
for _, runtimeFile := range runtimeFiles {
suggestedPath, err := xdg.RuntimeFile(runtimeFile)
require.NoError(t, err)
require.Equal(t, true, strings.HasPrefix(suggestedPath, os.TempDir()))
require.True(t, strings.HasPrefix(suggestedPath, os.TempDir()))

f, err := os.Create(suggestedPath)
require.NoError(t, err)
require.NoError(t, f.Close())
defer os.Remove(suggestedPath)
require.NoError(t, f.Close())

foundPath, err := xdg.SearchRuntimeFile(runtimeFile)
require.NoError(t, err)
Expand Down

0 comments on commit b92dacd

Please sign in to comment.