diff --git a/cmdlang/builtins.go b/cmdlang/builtins.go index 6499942..ab9ce24 100644 --- a/cmdlang/builtins.go +++ b/cmdlang/builtins.go @@ -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) { diff --git a/cmdlang/inst_test.go b/cmdlang/inst_test.go index 51db215..ca9bcb6 100644 --- a/cmdlang/inst_test.go +++ b/cmdlang/inst_test.go @@ -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