func TestNgons(t *testing.T) { gon := NewNGon(3) gon.Set(0, []int{2, 5, 8}) gon.Set(1, []int{1, 6, 7}) gon.Set(2, []int{3, 4, 9}) assert.Equal(t, "gon.Get()", []int{2, 9, 6}, gon.Get(0)) assert.Equal(t, "gon.String()", "sum: 11: first: 1 1,6,4; 3,4,9; 2,9,6", gon.String()) assert.Equal(t, "gon.Copy()", gon, gon.Copy()) actualInt, err := gon.ToInt() assert.ErrIsNil(t, "gon.ToInt()", err) assert.Equal(t, "gon.ToInt()", int64(164349296), actualInt) }
func TestRealMain(t *testing.T) { badArgs := [][]string{ []string{}, []string{"does not exist"}, []string{"a", "b"}, } for _, args := range badArgs { _, err := realMain(args) assert.ErrContains(t, "realMain()", err, "Only 1 arg accepted from this list") } _, err := realMain([]string{"fortesting"}) assert.ErrIsNil(t, "realMain()", err) }