Created
July 8, 2019 20:54
-
-
Save mottet-dev/8e2b66cca37d72202dc2a03d84da62c3 to your computer and use it in GitHub Desktop.
Go test - Not In Slice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func TestDoesSliceIncludesIntNotInSlice(t *testing.T) { | |
inputValue := 4 | |
inputSlice := []int{1, 2, 3} | |
expectedOutput := false | |
got := DoesSliceIncludesInt(inputValue, inputSlice) | |
if got != expectedOutput { | |
t.Errorf("SliceIncludesInt(%d, %d) = %t; want %t", inputValue, inputSlice, got, expectedOutput) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment