use pttodo.Todos.Like...()
This commit is contained in:
17
pttodo/todos_test.go
Normal file
17
pttodo/todos_test.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package pttodo
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestTodosLikeTags(t *testing.T) {
|
||||
todos := Todos{
|
||||
{Todo: "a", Tags: "x"},
|
||||
{Todo: "b", Tags: "x,y"},
|
||||
}
|
||||
|
||||
result := todos.LikeTags([]string{"x", "-y"})
|
||||
if len(result) != 1 {
|
||||
t.Error(result)
|
||||
} else if result[0].Todo != "a" {
|
||||
t.Error(result[0].Todo)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user