github.com/tunabay/go-bitarray@v1.3.1/alignment_test.go (about)

     1  // Copyright (c) 2021 Hirotsuna Mizuno. All rights reserved.
     2  // Use of this source code is governed by the MIT license that can be found in
     3  // the LICENSE file.
     4  
     5  package bitarray_test
     6  
     7  import (
     8  	"testing"
     9  
    10  	"github.com/tunabay/go-bitarray"
    11  )
    12  
    13  func TestAlignment_String(t *testing.T) {
    14  	var zero bitarray.Alignment
    15  	tcs := []struct {
    16  		a bitarray.Alignment
    17  		s string
    18  	}{
    19  		{zero, "align-left"},
    20  		{bitarray.AlignLeft, "align-left"},
    21  		{bitarray.AlignRight, "align-right"},
    22  	}
    23  	for _, tc := range tcs {
    24  		s := tc.a.String()
    25  		if s != tc.s {
    26  			t.Errorf("unexpected result: got %q, want %q", s, tc.s)
    27  		}
    28  	}
    29  }