github.com/mem/u-root@v2.0.1-0.20181004165302-9b18b4636a33+incompatible/cmds/elvish/eval/builtin_fn_misc_test.go (about) 1 package eval 2 3 import ( 4 "testing" 5 ) 6 7 func TestBuiltinFnMisc(t *testing.T) { 8 runTests(t, []Test{ 9 That("resolve for").Puts("special"), 10 That("resolve put").Puts("$put~"), 11 That("fn f { }; resolve f").Puts("$f~"), 12 That("use lorem; resolve lorem:put-name").Puts( 13 "$lorem:put-name~"), 14 That("resolve cat").Puts("(external cat)"), 15 16 That(`f = (mktemp elvXXXXXX); echo 'put x' > $f 17 -source $f; rm $f`).Puts("x"), 18 That(`f = (mktemp elvXXXXXX); echo 'put $x' > $f 19 fn p [x]{ -source $f }; p x; rm $f`).Puts("x"), 20 }) 21 }