integers: add testable examples
This commit is contained in:
parent
effff8ae16
commit
bdef054bb6
@ -1,6 +1,15 @@
|
|||||||
package integers
|
package integers
|
||||||
|
|
||||||
import "testing"
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ExampleAdd() {
|
||||||
|
sum := Add(1, 5)
|
||||||
|
fmt.Println(sum)
|
||||||
|
// Output: 6
|
||||||
|
}
|
||||||
|
|
||||||
func TestAdder(t *testing.T) {
|
func TestAdder(t *testing.T) {
|
||||||
sum := Add(2, 2)
|
sum := Add(2, 2)
|
||||||
|
Loading…
Reference in New Issue
Block a user