func TestTreeSetValue(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	tree := createTree(assert)
	old, err := tree.At("root", "alpha").SetValue("beta")
	assert.Nil(err)
	assert.Equal(old, "alpha")
	act, err := tree.At("root", "beta").Value()
	assert.Nil(err)
	assert.Equal(act, "beta")
	root, err := tree.Root().Value()
	assert.Nil(err)
	assert.Equal(root, "root")
	tree = collections.NewTree("root", false)
	err = tree.At("root").Add("alpha")
	assert.Nil(err)
	err = tree.At("root").Add("beta")
	assert.Nil(err)
	old, err = tree.At("root", "alpha").SetValue("beta")
	assert.Nil(old)
	assert.ErrorMatch(err, ".* duplicates are not allowed")
}
TestTreeSetValue tests the setting of a tree nodes value.
package collections_test
import (
	"errors"
	"fmt"
	"strings"
	"testing"
	"github.com/tideland/golib/audit"
	"github.com/tideland/golib/collections"
)
func TestTreeCreate(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	tree := collections.NewTree("root", true)
	err := tree.At("root").Add("alpha")
	assert.Nil(err)
	err = tree.At("root").Add("bravo")
	assert.Nil(err)
	err = tree.At("root").Add("bravo")
	assert.Nil(err)
	err = tree.At("root").Add("charlie")
	assert.Nil(err)
	err = tree.Create("root", "delta", 1).Add(true)
	assert.Nil(err)
	assert.Length(tree, 8)
	tree.Deflate("toor")
	assert.Length(tree, 1)
	err = tree.At("foo").Add(0)
	assert.ErrorMatch(err, ".* node not found")
	err = tree.At("root", "foo").Add(0)
	assert.ErrorMatch(err, ".* node not found")
	tree = collections.NewTree("root", false)
	err = tree.At("root").Add("alpha")
	assert.Nil(err)
	err = tree.At("root").Add("bravo")
	assert.Nil(err)
	err = tree.At("root").Add("bravo")
	assert.ErrorMatch(err, ".* duplicates are not allowed")
}
func TestTreeRemove(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	tree := createTree(assert)
	err := tree.At("root", "alpha").Remove()
	assert.Nil(err)
	assert.Length(tree, 11)
	err = tree.At("root", "delta").Remove()
	assert.Nil(err)
	assert.Length(tree, 6)
}