diff options
author | Fumitoshi Ukai <fumitoshi.ukai@gmail.com> | 2015-04-16 10:28:27 +0900 |
---|---|---|
committer | Fumitoshi Ukai <fumitoshi.ukai@gmail.com> | 2015-04-16 10:28:27 +0900 |
commit | b2670d94c8d4574636ea147c39f4ef6e94de892b (patch) | |
tree | 6c04362814ccd6f7eadff84967ef2498a493be80 /expr_test.go | |
parent | 9b10ecf5a3fad125532f1159fe24ff455898e673 (diff) | |
download | kati-b2670d94c8d4574636ea147c39f4ef6e94de892b.tar.gz |
change f.closure.args[0] has "(funcname", or "{funcname".
remove f.closure.expr
fclosure.String would not be called so often now
(except debug logging?), and keeping expr would require lots of memory.
Diffstat (limited to 'expr_test.go')
-rw-r--r-- | expr_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/expr_test.go b/expr_test.go index 0cf245a..5682855 100644 --- a/expr_test.go +++ b/expr_test.go @@ -53,6 +53,7 @@ func TestParseExpr(t *testing.T) { &funcSubst{ fclosure: fclosure{ args: []Value{ + literal("(subst"), varref{ varname: literal("space"), }, @@ -63,7 +64,6 @@ func TestParseExpr(t *testing.T) { varname: literal("foo"), }, }, - expr: "$(subst $(space),$(,),$(foo))", }, }, literal("/bar"), @@ -74,6 +74,7 @@ func TestParseExpr(t *testing.T) { val: &funcSubst{ fclosure: fclosure{ args: []Value{ + literal("(subst"), varref{ varname: literal("space"), }, @@ -87,7 +88,6 @@ func TestParseExpr(t *testing.T) { }, }, }, - expr: "$(subst $(space),$,,$(foo))", }, }, }, @@ -96,9 +96,9 @@ func TestParseExpr(t *testing.T) { val: &funcShell{ fclosure: fclosure{ args: []Value{ + literal("(shell"), literal("echo '()'"), }, - expr: `$(shell echo '()')`, }, }, }, @@ -107,9 +107,9 @@ func TestParseExpr(t *testing.T) { val: &funcShell{ fclosure: fclosure{ args: []Value{ + literal("{shell"), literal("echo '()'"), }, - expr: `${shell echo '()'}`, }, }, }, @@ -119,9 +119,9 @@ func TestParseExpr(t *testing.T) { &funcShell{ fclosure: fclosure{ args: []Value{ + literal("(shell"), literal("echo '"), }, - expr: `$(shell echo ')`, }, }, literal("')"), @@ -132,9 +132,9 @@ func TestParseExpr(t *testing.T) { val: &funcShell{ fclosure: fclosure{ args: []Value{ + literal("{shell"), literal("echo ')'"), }, - expr: `${shell echo ')'}`, }, }, }, @@ -144,9 +144,9 @@ func TestParseExpr(t *testing.T) { &funcShell{ fclosure: fclosure{ args: []Value{ + literal("{shell"), literal("echo '"), }, - expr: `${shell echo '}`, }, }, literal("'}"), @@ -157,9 +157,9 @@ func TestParseExpr(t *testing.T) { val: &funcShell{ fclosure: fclosure{ args: []Value{ + literal("(shell"), literal(`make --version | ruby -n0e 'puts $_[/Make (\d)/,1]'`), }, - expr: `$(shell make --version | ruby -n0e 'puts $$_[/Make (\d)/,1]')`, }, }, }, |