Created
December 18, 2019 11:10
-
-
Save chaoticryptidz/4df9aff07cbbd9f8c0bbd216cc15959d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var doesMatchTagsTests = []struct { | |
searchTags []string | |
post Post | |
result bool | |
}{ | |
{ | |
[]string{"potato"}, | |
Post{ | |
Tags: []string{"tomato"}, | |
}, | |
false, | |
}, | |
{ | |
[]string{"-potato"}, | |
Post{ | |
Tags: []string{"potato"}, | |
}, | |
false, | |
}, | |
{ | |
[]string{"potato"}, | |
Post{ | |
Tags: []string{"potato"}, | |
}, | |
true, | |
}, | |
{ | |
[]string{"*"}, | |
Post{ | |
Tags: []string{"potato"}, | |
}, | |
true, | |
}, | |
{ | |
[]string{"-*"}, | |
Post{ | |
Tags: []string{"potato"}, | |
}, | |
false, | |
}, | |
{ | |
[]string{""}, | |
Post{ | |
Tags: []string{"potato"}, | |
}, | |
false, | |
}, | |
{ | |
[]string{"tomato"}, | |
Post{ | |
Tags: []string{"potato", "tomato"}, | |
}, | |
true, | |
}, | |
{ | |
[]string{"tomato"}, | |
Post{ | |
Tags: []string{"tomato", "potato"}, | |
}, | |
true, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment