integers: add testable examples
This commit is contained in:
		@ -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)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user