fix
This commit is contained in:
@@ -210,17 +210,18 @@ func TestAjaxChangeOrder(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFilterComplete(t *testing.T) {
|
||||
task := &task.Task{Complete: false}
|
||||
cases := []struct {
|
||||
query string
|
||||
task bool
|
||||
out bool
|
||||
}{
|
||||
{query: "", out: true},
|
||||
{query: "0", out: true},
|
||||
{query: "1", out: false},
|
||||
{query: "", out: true, task: false},
|
||||
{query: "0", out: true, task: false},
|
||||
{query: "1", out: true, task: false},
|
||||
}
|
||||
|
||||
for name, c := range cases {
|
||||
task := &task.Task{Complete: c.task}
|
||||
out := filterComplete(c.query)
|
||||
if out(task) != c.out {
|
||||
t.Errorf("[%d] want %v, got %v", name, c.out, out(task))
|
||||
|
||||
Reference in New Issue
Block a user