diff options
author | Fumitoshi Ukai <fumitoshi.ukai@gmail.com> | 2015-04-10 17:30:04 +0900 |
---|---|---|
committer | Fumitoshi Ukai <fumitoshi.ukai@gmail.com> | 2015-04-10 17:35:10 +0900 |
commit | ebf945cad6d09f51e6255d8e5ed563e53eb923ef (patch) | |
tree | 7f38357cf3c38406e1514555010f67d52c254cf0 /expr_test.go | |
parent | 757f420c5d4e6fd9e15137d591b424ac5b12f699 (diff) | |
download | kati-ebf945cad6d09f51e6255d8e5ed563e53eb923ef.tar.gz |
preserve func expression to make Func.String() faster.
maybe better to revisit it's worth doing.
before:
% ./run_integration_test.rb android
tar -xzf ../android.tgz
Running make for android... 5.78 secs
Running kati for android... 62.50 secs
android: OK
PASS!
after:
% ./run_integration_test.rb android
tar -xzf ../android.tgz
Running make for android... 5.85 secs
Running kati for android... 61.93 secs
android: OK
PASS!
Diffstat (limited to 'expr_test.go')
-rw-r--r-- | expr_test.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/expr_test.go b/expr_test.go index e0bdf5b..0cf245a 100644 --- a/expr_test.go +++ b/expr_test.go @@ -63,6 +63,7 @@ func TestParseExpr(t *testing.T) { varname: literal("foo"), }, }, + expr: "$(subst $(space),$(,),$(foo))", }, }, literal("/bar"), @@ -86,6 +87,7 @@ func TestParseExpr(t *testing.T) { }, }, }, + expr: "$(subst $(space),$,,$(foo))", }, }, }, @@ -96,16 +98,18 @@ func TestParseExpr(t *testing.T) { args: []Value{ literal("echo '()'"), }, + expr: `$(shell echo '()')`, }, }, }, { - in: `$(shell echo '()')`, + in: `${shell echo '()'}`, val: &funcShell{ fclosure: fclosure{ args: []Value{ literal("echo '()'"), }, + expr: `${shell echo '()'}`, }, }, }, @@ -117,6 +121,7 @@ func TestParseExpr(t *testing.T) { args: []Value{ literal("echo '"), }, + expr: `$(shell echo ')`, }, }, literal("')"), @@ -129,6 +134,7 @@ func TestParseExpr(t *testing.T) { args: []Value{ literal("echo ')'"), }, + expr: `${shell echo ')'}`, }, }, }, @@ -140,6 +146,7 @@ func TestParseExpr(t *testing.T) { args: []Value{ literal("echo '"), }, + expr: `${shell echo '}`, }, }, literal("'}"), @@ -152,6 +159,7 @@ func TestParseExpr(t *testing.T) { args: []Value{ literal(`make --version | ruby -n0e 'puts $_[/Make (\d)/,1]'`), }, + expr: `$(shell make --version | ruby -n0e 'puts $$_[/Make (\d)/,1]')`, }, }, }, |