elvish/pkg/eval/builtin_ns_test.go
Qi Xiao c1dce661b7 Fix use of the builtin module via explicit "builtin".
Some of the variables are added after the Evaler is created, but that change was
not synchronized back to the copy of the builtin module that is imported with
"use builtin".

This fixes #1414.
2021-10-28 22:28:13 +01:00

18 lines
380 B
Go

package eval_test
import (
"testing"
. "src.elv.sh/pkg/eval"
. "src.elv.sh/pkg/eval/evaltest"
"src.elv.sh/pkg/eval/vals"
)
func TestExplicitBuiltinModule(t *testing.T) {
TestWithSetup(t, func(ev *Evaler) { ev.Args = vals.MakeList("a", "b") },
That("all $args").Puts("a", "b"),
// Regression test for #1414
That("use builtin; all $builtin:args").Puts("a", "b"),
)
}