Skip to content

Instantly share code, notes, and snippets.

@adilw3nomad
Created June 3, 2019 06:36
Show Gist options
  • Save adilw3nomad/2877e82cc8df4daf2d408550e0584287 to your computer and use it in GitHub Desktop.
Save adilw3nomad/2877e82cc8df4daf2d408550e0584287 to your computer and use it in GitHub Desktop.
go
package main
import “testing”
func TestCheckCorrectAnswer(t *testing.T) {
got := CheckAnswer(“3”, “3”)
if got != “Correct! Well done” {
t.Errorf(“CheckCorrectAnswer = %v; want ‘Correct! Well Done’”, got)
}
}
func TestCheckIncorrectAnswer(t *testing.T) {
got := CheckAnswer(“3”, “2”)
if got != “WRONG! Answer is: 2” {
t.Errorf(“CheckIncorrectAnswer = %v; want ‘WRONG! Answer is: 2’”, got)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment