mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
Added test for DataContains function in common.go
This commit is contained in:
committed by
Adrian Gallagher
parent
03aca79584
commit
58741e73ef
@@ -129,6 +129,23 @@ func TestStringContains(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDataContains(t *testing.T) {
|
||||
t.Parallel()
|
||||
originalHaystack := []string{"hello", "world", "data", "Contains", "string"}
|
||||
originalNeedle := "world"
|
||||
anotherNeedle := "thing"
|
||||
expectedOutput := true
|
||||
expectedOutputTwo := false
|
||||
actualResult := DataContains(originalHaystack, originalNeedle)
|
||||
if actualResult != expectedOutput {
|
||||
t.Error(fmt.Sprintf("Test failed. Expected '%t'. Actual '%t'", expectedOutput, actualResult))
|
||||
}
|
||||
actualResult = DataContains(originalHaystack, anotherNeedle)
|
||||
if actualResult != expectedOutputTwo {
|
||||
t.Error(fmt.Sprintf("Test failed. Expected '%t'. Actual '%t'", expectedOutputTwo, actualResult))
|
||||
}
|
||||
}
|
||||
|
||||
func TestJoinStrings(t *testing.T) {
|
||||
t.Parallel()
|
||||
originalInputOne := []string{"hello", "moto"}
|
||||
|
||||
Reference in New Issue
Block a user