parent
6470a56fac
commit
23fc68cc91
|
@ -1,10 +1,11 @@
|
|||
## 0.12.17 (Unreleased)
|
||||
## 0.12.16 (November 18, 2019)
|
||||
|
||||
NEW FEATURES:
|
||||
|
||||
* lang/funcs: Add `trim*` functions
|
||||
|
||||
## 0.12.16 (November 18, 2019)
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* command/0.12upgrade: fix panic when int value is out of range ([#23394](https://github.com/hashicorp/terraform/issues/23394))
|
||||
|
|
|
@ -118,7 +118,10 @@ func (s *Scope) Functions() map[string]function.Function {
|
|||
"tolist": funcs.MakeToFunc(cty.List(cty.DynamicPseudoType)),
|
||||
"tomap": funcs.MakeToFunc(cty.Map(cty.DynamicPseudoType)),
|
||||
"transpose": funcs.TransposeFunc,
|
||||
"trim": funcs.TrimFunc,
|
||||
"trimprefix": funcs.TrimPrefixFunc,
|
||||
"trimspace": funcs.TrimSpaceFunc,
|
||||
"trimsuffix": funcs.TrimSuffixFunc,
|
||||
"upper": stdlib.UpperFunc,
|
||||
"urlencode": funcs.URLEncodeFunc,
|
||||
"uuid": funcs.UUIDFunc,
|
||||
|
|
|
@ -837,6 +837,20 @@ func TestFunctions(t *testing.T) {
|
|||
},
|
||||
},
|
||||
|
||||
"trim": {
|
||||
{
|
||||
`trim("?!hello?!", "!?")`,
|
||||
cty.StringVal("hello"),
|
||||
},
|
||||
},
|
||||
|
||||
"trimprefix": {
|
||||
{
|
||||
`trimprefix("helloworld", "hello")`,
|
||||
cty.StringVal("world"),
|
||||
},
|
||||
},
|
||||
|
||||
"trimspace": {
|
||||
{
|
||||
`trimspace(" hello ")`,
|
||||
|
@ -844,6 +858,13 @@ func TestFunctions(t *testing.T) {
|
|||
},
|
||||
},
|
||||
|
||||
"trimsuffix": {
|
||||
{
|
||||
`trimsuffix("helloworld", "world")`,
|
||||
cty.StringVal("hello"),
|
||||
},
|
||||
},
|
||||
|
||||
"upper": {
|
||||
{
|
||||
`upper("hello")`,
|
||||
|
|
Loading…
Reference in New Issue