github.com/soypat/gitaligned@v0.3.4-0.20221228122414-e435aab44fbc/align_test.go (about)

     1  package main
     2  
     3  import "testing"
     4  
     5  func TestAlignmentFormat(t *testing.T) {
     6  	var tests = []struct {
     7  		alignment
     8  		expected string
     9  	}{
    10  		{alignment{}, "True Neutral"},
    11  		{alignment{-1., 0}, "Chaotic Neutral"},
    12  		{alignment{1., 0}, "Lawful Neutral"},
    13  		{alignment{0, 1.}, "Neutral Good"},
    14  		{alignment{0, -1.}, "Neutral Evil"},
    15  		{alignment{-1., 1.}, "Chaotic Good"},
    16  		{alignment{1., 1.}, "Lawful Good"},
    17  		{alignment{-1., -1.}, "Chaotic Evil"},
    18  	}
    19  	for i := range tests {
    20  		if tests[i].Format() != tests[i].expected {
    21  			t.Errorf("expected %q, got %q for %#v", tests[i].expected, tests[i].Format(), tests[i].alignment)
    22  		}
    23  	}
    24  }