Skip to content

Commit

Permalink
additional test and doc for none
Browse files Browse the repository at this point in the history
  • Loading branch information
mandelsoft committed Feb 23, 2019
1 parent 2ca1e0a commit 6745fd9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Contents:
- [<<: (( merge foo ))](#--merge-foo-)
- [merging maps](#merging-maps-3)
- [merging lists](#merging-lists-3)
- [<<: (( merge none ))](#--merge-none-)
- [(( a || b ))](#-a--b-)
- [(( 1 + 2 * foo ))](#-1--2--foo-)
- [(( "10.10.10.10" - 11 ))](#-10101010---11-)
Expand Down Expand Up @@ -958,7 +959,7 @@ foo:
### `<<: (( merge none ))`

If the reference of an redirecting merge is set to the constant `none`,
no merge is done at all.
no merge is done at all. This expressions always yields the nil value.

e.g.: for

Expand Down Expand Up @@ -1012,7 +1013,7 @@ This also works for dedicated fields:
**template.yml**
```yaml
map:
value: (( merge none // "alice" "+" stub(map.value) ))
value: (( merge none // "alice" "+" stub() ))
```

**values.yml**
Expand Down
21 changes: 21 additions & 0 deletions flow/flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6354,6 +6354,27 @@ value: merged
resolved := parseYAML(`
---
value: not merged
`)
Expect(source).To(FlowAs(resolved, stub))
})

It("is aggregatable", func() {
source := parseYAML(`
---
map:
<<: (( merge none ))
value: (( "alice and " stub() ))
`)
stub := parseYAML(`
---
map:
value: bob
`)

resolved := parseYAML(`
---
map:
value: alice and bob
`)
Expect(source).To(FlowAs(resolved, stub))
})
Expand Down

0 comments on commit 6745fd9

Please sign in to comment.