Files
kong/interpolate_test.go
T
2021-12-04 21:06:33 +11:00

20 lines
464 B
Go

package kong
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestInterpolate(t *testing.T) {
vars := map[string]string{
"age": "35",
}
updatedVars := map[string]string{
"height": "180",
}
actual, err := interpolate("${name=Bobby Brown} is ${age} years old and ${height} cm tall and likes $${AUD}", vars, updatedVars)
require.NoError(t, err)
require.Equal(t, `Bobby Brown is 35 years old and 180 cm tall and likes ${AUD}`, actual)
}