go.charczuk.com@v0.0.0-20240327042549-bc490516bd1a/sdk/selector/equals_test.go (about)

     1  /*
     2  
     3  Copyright (c) 2023 - Present. Will Charczuk. All rights reserved.
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file at the root of the repository.
     5  
     6  */
     7  
     8  package selector
     9  
    10  import (
    11  	"testing"
    12  
    13  	. "go.charczuk.com/sdk/assert"
    14  )
    15  
    16  func Test_Equals(t *testing.T) {
    17  
    18  	valid := Labels{
    19  		"foo": "far",
    20  		"moo": "bar",
    21  	}
    22  	ItsEqual(t, true, Equals{Key: "foo", Value: "far"}.Matches(valid))
    23  	ItsEqual(t, false, Equals{Key: "zoo", Value: "buzz"}.Matches(valid))
    24  	ItsEqual(t, false, Equals{Key: "foo", Value: "bar"}.Matches(valid))
    25  
    26  	ItsEqual(t, "foo == bar", Equals{Key: "foo", Value: "bar"}.String())
    27  }