use pttodo.Todos.Like...()

This commit is contained in:
Bel LaPointe
2023-11-06 13:06:11 -07:00
parent 39345e5e2a
commit bfdeebb7a2
3 changed files with 55 additions and 26 deletions

17
pttodo/todos_test.go Normal file
View 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)
}
}