diff options
author | Fumitoshi Ukai <fumitoshi.ukai@gmail.com> | 2015-04-28 00:08:09 +0900 |
---|---|---|
committer | Fumitoshi Ukai <fumitoshi.ukai@gmail.com> | 2015-04-28 00:11:07 +0900 |
commit | d8cec17d195a8149bd3c7ca913e237e9d9e8bca8 (patch) | |
tree | 987b3c1ea4ff0b9ff9263218bcb8df321a6b63f8 /expr_test.go | |
parent | 1d9590718d732227a18125ccd3c050f38bfe6117 (diff) | |
download | kati-d8cec17d195a8149bd3c7ca913e237e9d9e8bca8.tar.gz |
Revert "Revert "fix: handle $(eval foo := $(var)) case""
This reverts commit 5fbd0bdf4551af6b9233a0d52e1138cfba882a93.
rhs should trim left after 1st eval
Diffstat (limited to 'expr_test.go')
-rw-r--r-- | expr_test.go | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/expr_test.go b/expr_test.go index febe438..7cc7747 100644 --- a/expr_test.go +++ b/expr_test.go @@ -226,40 +226,46 @@ func TestParseExpr(t *testing.T) { rhs: literal(""), }, }, - /* - { - in: `$(eval foo := $(bar))`, - val: &funcEvalAssign{ - lhs: "foo", - op: ":=", - rhs: varref{ - literal("bar"), - }, + { + in: `$(eval foo := $(bar))`, + val: &funcEvalAssign{ + lhs: "foo", + op: ":=", + rhs: varref{ + literal("bar"), }, }, - { - in: `$(strip $1)`, - val: &funcStrip{ - fclosure: fclosure{ - args: []Value{ - literal("(strip"), - paramref(1), - }, + }, + { + in: `$(eval foo := $$(bar))`, + val: &funcEvalAssign{ + lhs: "foo", + op: ":=", + rhs: literal("$(bar)"), + }, + }, + { + in: `$(strip $1)`, + val: &funcStrip{ + fclosure: fclosure{ + args: []Value{ + literal("(strip"), + paramref(1), }, }, }, - { - in: `$(strip $(1))`, - val: &funcStrip{ - fclosure: fclosure{ - args: []Value{ - literal("(strip"), - paramref(1), - }, + }, + { + in: `$(strip $(1))`, + val: &funcStrip{ + fclosure: fclosure{ + args: []Value{ + literal("(strip"), + paramref(1), }, }, }, - */ + }, } { val, _, err := parseExpr([]byte(tc.in), nil) if tc.isErr { |