From 82a6eac872a91bef2d901a37404a6a3a449bd13a Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Thu, 11 Apr 2024 22:32:38 +1000 Subject: [PATCH] Some more test updates --- cmdlang/builtins.go | 4 ++-- cmdlang/inst_test.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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