Changeset bf5f58b35044…
Parent c381bb2b7e39…
by Hao Lian <hao@fogcreek.com>
Changes to 2 files · Browse files at bf5f58b35044 Showing diff from parent c381bb2b7e39 Diff from another changeset...
@@ -45,7 +45,7 @@ let filterName = ["author"; "file"; "project"; "repo"] |> Seq.map pstring |> choice
let regularFilter =
(filterName |>> findFilter)
- .>> (pchar ':')
+ .>>? (pchar ':')
.>>. (phrase <|> word <?> "filter argument")
|>> pipeline
let dateWord = many1Chars <| noneOf ". "
|
@@ -90,3 +90,16 @@ member this.TestsInvalidDate() =
let f () = parse "date:\"many moons ago\"..today eggs" |> ignore
throwsParseError f "Unrecognized date"
+
+ [<TestMethod>]
+ member this.TestsFilterAlternation() =
+ equals (parse "projects") [KeywordAtom <| Word "projects"]
+
+ [<TestMethod>]
+ member this.TestsFilterAlternation2() =
+ equals (parse "proj") [KeywordAtom <| Word "proj"]
+
+ [<TestMethod>]
+ member this.TestsEmptyFilter2() =
+ let f () = parse "project:" |> ignore
+ throwsParseError f "filter argument"
\ No newline at end of file |
Loading...