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) { func echoBuiltin(ctx context.Context, args invocationArgs) (object, error) {
if len(args.args) == 0 { if len(args.args) == 0 {
return asStream(strObject("")), nil return strObject(""), nil
} }
var line strings.Builder 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) { func setBuiltin(ctx context.Context, args invocationArgs) (object, error) {

View file

@ -29,6 +29,7 @@ func TestInst_Eval(t *testing.T) {
// Pipeline // Pipeline
{desc: "pipe 1", expr: `pipe "aye" "bee" "see" | joinpipe`, want: "aye,bee,see"}, {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 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 {desc: "ignored pipe", expr: `pipe "aye" "bee" "see" | firstarg "ignore me"`, want: "ignore me"}, // TODO: check for leaks