File: os_helper_test.go

package info (click to toggle)
golang-github-viant-toolbox 0.33.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 1,280 kB
  • sloc: makefile: 16
file content (16 lines) | stat: -rw-r--r-- 358 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package toolbox_test

import (
	"github.com/stretchr/testify/assert"
	"github.com/viant/toolbox"
	"testing"
)

func TestCreateDirIfNotExist(t *testing.T) {
	dir := "/tmp/abc"
	toolbox.RemoveFileIfExist(dir)
	toolbox.CreateDirIfNotExist(dir)
	assert.True(t, toolbox.FileExists(dir))
	toolbox.RemoveFileIfExist(dir)
	assert.False(t, toolbox.FileExists(dir))
}