config/lang: add test with expressions

This commit is contained in:
Mitchell Hashimoto 2015-02-26 14:34:45 -08:00
parent 9ddcaf15eb
commit 6750318bb5
1 changed files with 15 additions and 0 deletions

View File

@ -95,6 +95,21 @@ func TestEval(t *testing.T) {
ast.TypeString, ast.TypeString,
}, },
{
"foo ${bar+1}",
&ast.BasicScope{
VarMap: map[string]ast.Variable{
"bar": ast.Variable{
Value: 41,
Type: ast.TypeInt,
},
},
},
false,
"foo 42",
ast.TypeString,
},
{ {
"foo ${rand()}", "foo ${rand()}",
&ast.BasicScope{ &ast.BasicScope{