add more tests for ElementSetter

This commit is contained in:
Donny Xia
2020-11-03 15:23:34 -08:00
parent 3fed68b694
commit 6bed275234
2 changed files with 51 additions and 3 deletions

View File

@@ -41,10 +41,9 @@ func (a ElementAppender) Filter(rn *RNode) (*RNode, error) {
return nil, nil
}
// ElementSetter sets the value for an Element in an associative list. ElementSetter
// will remove any elements which are empty.
// ElementSetter sets the value for an Element in an associative list.
// ElementSetter will append, replace or delete an element in an associative list.
// To append, user a key-value pair that doesn't exist in the sequence. Note: this
// To append, user a key-value pair that doesn't exist in the sequence. this
// behavior is intended to handle the case that not matching element found. It's
// not designed for this purpose. To append an element, please use ElementAppender.
// To replace, set the key-value pair and a non-nil Element.