Skip to content

Commit

Permalink
✅ test added
Browse files Browse the repository at this point in the history
  • Loading branch information
noyshabtay committed Apr 7, 2024
1 parent ab49c71 commit 22e5a47
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions utils/fileutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,17 @@ func TestReadNLines(t *testing.T) {
assert.True(t, strings.HasPrefix(lines[1], "781"))
assert.True(t, strings.HasSuffix(lines[1], ":true}}}"))
}

func TestCreateTempDir(t *testing.T) {
tempDir, err := CreateTempDir()
assert.NoError(t, err)

_, err = os.Stat(tempDir)
assert.NotErrorIs(t, err, os.ErrNotExist)

// Check that a timestamp can be extracted from the temp dir name
_, err = extractTimestamp(tempDir)
assert.NoError(t, err)

assert.NoError(t, os.RemoveAll(tempDir))
}

0 comments on commit 22e5a47

Please sign in to comment.