github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/pkg/labels/common_test.go (about)

     1  package labels_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/caos/orbos/pkg/labels"
     7  
     8  	"gopkg.in/yaml.v3"
     9  )
    10  
    11  func expectNotMarshallable(t *testing.T, labels interface{}) {
    12  	_, err := yaml.Marshal(labels)
    13  	if err == nil {
    14  		t.Error("expected full set of labels")
    15  	}
    16  }
    17  
    18  func expectValueEquality(t *testing.T, one labels.Labels, oneTick labels.Labels, two labels.Labels) {
    19  
    20  	if one.Equal(two) {
    21  		t.Error("Expected unequal")
    22  	}
    23  
    24  	if !one.Equal(oneTick) {
    25  		t.Error("Expected value equality")
    26  	}
    27  }