mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-14 02:57:52 +08:00
19 lines
416 B
Go
19 lines
416 B
Go
package parse_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"src.elv.sh/pkg/eval/vals"
|
|
. "src.elv.sh/pkg/parse"
|
|
)
|
|
|
|
func TestSourceAsStructMap(t *testing.T) {
|
|
vals.TestValue(t, Source{Name: "[tty]", Code: "echo"}).
|
|
Kind("structmap").
|
|
Repr("[&name='[tty]' &code=<...> &is-file=$false]").
|
|
AllKeys("name", "code", "is-file")
|
|
|
|
vals.TestValue(t, Source{Name: "/etc/rc.elv", Code: "echo", IsFile: true}).
|
|
Index("is-file", true)
|
|
}
|