Some more test updates

This commit is contained in:
Leon Mika 2024-04-11 22:32:38 +10:00
parent 922acd3751
commit 82a6eac872
2 changed files with 3 additions and 2 deletions

View File

@ -11,7 +11,7 @@ import (
func echoBuiltin(ctx context.Context, args invocationArgs) (object, error) {
if len(args.args) == 0 {
return asStream(strObject("")), nil
return strObject(""), nil
}
var line strings.Builder
@ -21,7 +21,7 @@ func echoBuiltin(ctx context.Context, args invocationArgs) (object, error) {
}
}
return asStream(strObject(line.String())), nil
return strObject(line.String()), nil
}
func setBuiltin(ctx context.Context, args invocationArgs) (object, error) {

View File

@ -29,6 +29,7 @@ func TestInst_Eval(t *testing.T) {
// Pipeline
{desc: "pipe 1", expr: `pipe "aye" "bee" "see" | joinpipe`, want: "aye,bee,see"},
{desc: "pipe 2", expr: `pipe "aye" "bee" "see" | toUpper | joinpipe`, want: "AYE,BEE,SEE"},
{desc: "pipe 3", expr: `firstarg "normal" | toUpper | joinpipe`, want: "NORMAL"},
{desc: "ignored pipe", expr: `pipe "aye" "bee" "see" | firstarg "ignore me"`, want: "ignore me"}, // TODO: check for leaks