Simple test


examples/simple_test/comp.go
package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello")
	fmt.Println(add(2, 3))
}

func add(a, b int) int {
	return a + b
}


examples/simple_test/comp_test.go
package main

import "testing"

func TestSum(t *testing.T) {
	t.Log("Hello from the test")
	total := add(19, 23)
	if total != 42 {
		t.Errorf("Sum was incorrect")
	}
}


To run the tests:


got test -run ''