mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
26 lines
476 B
Go
26 lines
476 B
Go
package eval
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/elves/elvish/pkg/parse"
|
|
)
|
|
|
|
func TestBuiltinFnFS(t *testing.T) {
|
|
tmpHome, cleanup := InTempHome()
|
|
defer cleanup()
|
|
|
|
MustMkdirAll("dir", 0700)
|
|
MustCreateEmpty("file")
|
|
|
|
Test(t,
|
|
That(`path-base a/b/c.png`).Puts("c.png"),
|
|
That("tilde-abbr "+parse.Quote(filepath.Join(tmpHome, "foobar"))).
|
|
Puts(filepath.Join("~", "foobar")),
|
|
|
|
That(`-is-dir ~/dir`).Puts(true),
|
|
That(`-is-dir ~/file`).Puts(false),
|
|
)
|
|
}
|