-
Notifications
You must be signed in to change notification settings - Fork 840
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alex Flint
committed
May 25, 2018
1 parent
51e8a07
commit b2eedbf
Showing
4 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package graphql | ||
|
||
import "testing" | ||
|
||
func TestIsIterable(t *testing.T) { | ||
if !isIterable([]int{}) { | ||
t.Fatal("expected isIterable to return true for a slice, got false") | ||
} | ||
if !isIterable([]int{}) { | ||
t.Fatal("expected isIterable to return true for an array, got false") | ||
} | ||
if isIterable(1) { | ||
t.Fatal("expected isIterable to return false for an int, got true") | ||
} | ||
if isIterable(nil) { | ||
t.Fatal("expected isIterable to return false for nil, got true") | ||
} | ||
} |