github.com/haraldrudell/parl@v0.4.176/sets/set-element-full_test.go (about)

     1  /*
     2  © 2022–present Harald Rudell <harald.rudell@gmail.com> (https://haraldrudell.github.io/haraldrudell/)
     3  ISC License
     4  */
     5  
     6  package sets
     7  
     8  import "testing"
     9  
    10  func TestSetElementFull(t *testing.T) {
    11  	var value, name, full = 1, "nname", "ffull"
    12  
    13  	var element = SetElementFull[int]{
    14  		ValueV: value,
    15  		Name:   name,
    16  		Full:   full,
    17  	}
    18  
    19  	if element.Value() != value {
    20  		t.Errorf("Value %d exp %d", element.Value(), value)
    21  	}
    22  	if element.Description() != full {
    23  		t.Errorf("Description %q exp %q", element.Description(), full)
    24  	}
    25  	if element.String() != name {
    26  		t.Errorf("String %q exp %q", element.String(), name)
    27  	}
    28  
    29  	if _, ok := any(&element).(ElementDescription); !ok {
    30  		t.Error("is not ElementDescription")
    31  	}
    32  }