github.com/markusbkk/elvish@v0.0.0-20231204143114-91dc52438621/pkg/parse/source_test.go (about)

     1  package parse_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/markusbkk/elvish/pkg/eval/vals"
     7  	. "github.com/markusbkk/elvish/pkg/parse"
     8  )
     9  
    10  func TestSourceAsStructMap(t *testing.T) {
    11  	vals.TestValue(t, Source{Name: "[tty]", Code: "echo"}).
    12  		Kind("structmap").
    13  		Repr("[&name='[tty]' &code=<...> &is-file=$false]").
    14  		AllKeys("name", "code", "is-file")
    15  
    16  	vals.TestValue(t, Source{Name: "/etc/rc.elv", Code: "echo", IsFile: true}).
    17  		Index("is-file", true)
    18  }