github.com/gorgonia/agogo@v0.1.1/dualnet/config_test.go (about)

     1  package dual
     2  
     3  import "testing"
     4  
     5  var correctRounds = []struct{ a, correct int }{
     6  	{0, 0},
     7  	{1, 1},
     8  	{2, 2},
     9  	{3, 4},
    10  	{5, 4},
    11  	{8, 8},
    12  	{10, 8},
    13  	{31, 32},
    14  	{33, 32},
    15  	{80, 64},
    16  	{100, 128},
    17  }
    18  
    19  func TestRound(t *testing.T) {
    20  	for _, c := range correctRounds {
    21  		if b := round(c.a); b != c.correct {
    22  			t.Errorf("Expected rounding of %v to be %v. Got %v instead", c.a, c.correct, b)
    23  		}
    24  	}
    25  }
    26  
    27  func TestDefaultConfig(t *testing.T) {
    28  	if !DefaultConf(5, 5, 5*5+1).IsValid() {
    29  		t.Errorf("Expected Default Config to be correct")
    30  	}
    31  }