Skip to content

Instantly share code, notes, and snippets.

@Coollision
Created July 12, 2020 22:37
Show Gist options
  • Save Coollision/6b85d2fed22fbfeab251f8c5c0620aa2 to your computer and use it in GitHub Desktop.
Save Coollision/6b85d2fed22fbfeab251f8c5c0620aa2 to your computer and use it in GitHub Desktop.
GOLANG Introduction into Testing: basic main_test file
package main
import "testing"
func TestLastIndex(t *testing.T) {
list := []int{1, 2, 1, 1}
if got := lastIndex(list, 2); got != 1 {
t.Errorf("LastIndex(%v, %v) = %v, want %v", list, 2, got, 1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment