go-template/src/add_test.go
2024-01-05 16:24:45 +01:00

16 lines
353 B
Go

package main
import (
"testing"
)
// This file is named add_test.go by convention.
// The go test command will automatically detect this file and run it.
// All test files must be named *_test.go and all test functions must be named Test*.
// TestAdd is a test function
func TestAdd(t *testing.T) {
if add(1, 2) != 3 {
t.Error("Expected 3")
}
}