integers: add testable examples

This commit is contained in:
vinchent 2024-09-10 13:09:20 +02:00
parent effff8ae16
commit bdef054bb6

View File

@ -1,6 +1,15 @@
package integers
import "testing"
import (
"fmt"
"testing"
)
func ExampleAdd() {
sum := Add(1, 5)
fmt.Println(sum)
// Output: 6
}
func TestAdder(t *testing.T) {
sum := Add(2, 2)