import std/[options, tables, times, unittest] import pit/libpit suite "regex-backed issue behavior": test "summary and full-text filters are case-insensitive": let issue = Issue( summary: "Fix the Widget", details: "Failure happens in the renderer", properties: newTable[string, string](), tags: @[]) check @[issue].filter(summaryMatchFilter("widget")).len == 1 check @[issue].filter(summaryMatchFilter("missing")).len == 0 check @[issue].filter(fullMatchFilter("RENDERER")).len == 1 test "recurrence values parse captures": let issue = Issue( summary: "repeating", properties: newTable[string, string](), tags: @[]) issue["recurrence"] = "after 2 weeks, abc123" let recurrence = issue.getRecurrence() check recurrence.isSome check recurrence.get.isFromCompletion check recurrence.get.interval == weeks(2) check recurrence.get.cloneId == some("abc123")