-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a few tests for edge cases for contains, doesNotContain, startsWi…
…th, endsWith
- Loading branch information
lhitchon
committed
Sep 25, 2018
1 parent
6e11738
commit d95ab60
Showing
3 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package assertion | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
// The non error cases are covered in match_test | ||
|
||
func TestContainsWithNonJSONType(t *testing.T) { | ||
var complexNumber complex128 | ||
_, err := contains(complexNumber, "foo", "1") | ||
if err == nil { | ||
t.Errorf("Expecting contains to return an error for non JSON encodable data") | ||
} | ||
} | ||
|
||
func TestDoesNotContainWithNonJSONType(t *testing.T) { | ||
var complexNumber complex128 | ||
_, err := doesNotContain(complexNumber, "foo", "1") | ||
if err == nil { | ||
t.Errorf("Expecting doesNotContain to return an error for non JSON encodable data") | ||
} | ||
} |
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