-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also updated the build to correctly check if the generated files are in sync.
- Loading branch information
1 parent
a1ae87f
commit 7393722
Showing
3 changed files
with
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pie | ||
|
||
import ( | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
// There tests are just to make sure that the select functions for myInts are | ||
// generated. The more extensive tests for these functions are in ints_test.go | ||
|
||
func TestMyInts_Average(t *testing.T) { | ||
assert.Equal(t, 0.0, myInts(nil).Average()) | ||
assert.Equal(t, 4.333333333333333, myInts{1, 5, 7}.Average()) | ||
} | ||
|
||
func TestMyInts_Sum(t *testing.T) { | ||
assert.Equal(t, 13, myInts{1, 5, 7}.Sum()) | ||
} |