move CloneWith() call into interpolate()

This commit is contained in:
Will Roden
2020-05-15 16:36:04 -05:00
committed by Alec Thomas
parent f19cb8c69d
commit 7bdb319cf1
3 changed files with 24 additions and 14 deletions
+5 -2
View File
@@ -10,7 +10,10 @@ func TestInterpolate(t *testing.T) {
vars := map[string]string{
"age": "35",
}
actual, err := interpolate("${name=Bobby Brown} is ${age} years old", vars)
updatedVars := map[string]string{
"height": "180",
}
actual, err := interpolate("${name=Bobby Brown} is ${age} years old and ${height} cm tall", vars, updatedVars)
require.NoError(t, err)
require.Equal(t, `Bobby Brown is 35 years old`, actual)
require.Equal(t, `Bobby Brown is 35 years old and 180 cm tall`, actual)
}