github.com/verrazzano/verrazzano@v1.7.0/pkg/vzmap/vzmap_test.go (about)

     1  // Copyright (c) 2022, Oracle and/or its affiliates.
     2  // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     3  
     4  package vzmap
     5  
     6  import (
     7  	"github.com/stretchr/testify/assert"
     8  	"testing"
     9  )
    10  
    11  // TestUnionStringMaps verifies the union of two string maps
    12  func TestUnionStringMaps(t *testing.T) {
    13  	m1 := map[string]string{
    14  		"a": "1",
    15  		"b": "2",
    16  		"c": "3",
    17  	}
    18  	m2 := map[string]string{
    19  		"a": "1",
    20  		"e": "2",
    21  		"f": "5",
    22  	}
    23  
    24  	u := UnionStringMaps(m1, m2)
    25  	for k := range m1 {
    26  		assert.Equal(t, u[k], m1[k])
    27  	}
    28  	for k := range m2 {
    29  		assert.Equal(t, u[k], m2[k])
    30  	}
    31  }