jx/internal/folio/searchpath_test.go
Matthew Rich 8feb7b8d56
Some checks failed
Lint / golangci-lint (push) Failing after 10m1s
Declarative Tests / test (push) Failing after 14s
add support of import search paths [doublejynx/jx#7]
2024-10-16 10:26:42 -07:00

25 lines
456 B
Go

// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
package folio
import (
"github.com/stretchr/testify/assert"
"testing"
"os"
)
func TestSearchPath(t *testing.T) {
assert.Nil(t, TempDir.CreateFile("test.jx.yaml", ""))
sp := NewSearchPath(nil)
assert.NotNil(t, sp)
assert.Nil(t, sp.AddPath(string(TempDir)))
absPath := sp.Find("test.jx.yaml")
_, err := os.Stat(absPath)
assert.True(t, !os.IsNotExist(err))
}