Command: `gofmt -l -s -w .`
This commit is contained in:
Caleb Spare 2013-11-24 13:48:57 -08:00 committed by spf13
parent 1abc2f0b86
commit 6da23f7449
8 changed files with 30 additions and 32 deletions

View file

@ -6,19 +6,19 @@ import (
)
func TestGt(t *testing.T) {
for i, this := range []struct{
left interface{}
right interface{}
for i, this := range []struct {
left interface{}
right interface{}
leftShouldWin bool
}{
{ 5, 8, false },
{ 8, 5, true },
{ 5, 5, false },
{ -2, 1, false },
{ 2, -5, true },
{ "8", "5", true },
{ "5", "0001", true },
{ []int{100,99}, []int{1,2,3,4}, false },
{5, 8, false},
{8, 5, true},
{5, 5, false},
{-2, 1, false},
{2, -5, true},
{"8", "5", true},
{"5", "0001", true},
{[]int{100, 99}, []int{1, 2, 3, 4}, false},
} {
leftIsBigger := Gt(this.left, this.right)
if leftIsBigger != this.leftShouldWin {
@ -34,14 +34,14 @@ func TestGt(t *testing.T) {
}
func TestFirst(t *testing.T) {
for i, this := range []struct{
count int
for i, this := range []struct {
count int
sequence interface{}
expect interface{}
} {
{ 2, []string{"a", "b", "c"}, []string{"a", "b"} },
{ 3, []string{"a", "b"}, []string{"a", "b"} },
{ 2, []int{100, 200, 300}, []int{100, 200} },
expect interface{}
}{
{2, []string{"a", "b", "c"}, []string{"a", "b"}},
{3, []string{"a", "b"}, []string{"a", "b"}},
{2, []int{100, 200, 300}, []int{100, 200}},
} {
results, err := First(this.count, this.sequence)
if err != nil {