30 lines
673 B
Go
30 lines
673 B
Go
package util
|
|
|
|
import (
|
|
"testing"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/suite"
|
|
)
|
|
|
|
// define our test suite struct
|
|
type EnvTestSuite struct {
|
|
suite.Suite
|
|
}
|
|
|
|
// the tilde should expand to user's home directory
|
|
func (s *EnvTestSuite) TestResolveTilde() {
|
|
resolvedPath := ResolveTilde("~")
|
|
assert.NotEqual(s.T(), resolvedPath, "~")
|
|
}
|
|
|
|
// ensure the tilde + relative path gets expanded fully
|
|
func (s *EnvTestSuite) TestResolveTildePath() {
|
|
resolvedPath := ResolveTilde("~/test")
|
|
assert.NotEqual(s.T(), resolvedPath, "~/test")
|
|
}
|
|
|
|
// this is needed to run the test suite
|
|
func TestEnvTestSuite(t *testing.T) {
|
|
suite.Run(t, new(EnvTestSuite))
|
|
}
|