Skip to content

Instantly share code, notes, and snippets.

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