Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hierarchical tags #115

Merged
merged 25 commits into from
Apr 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests for hierarchical tags in query
  • Loading branch information
felko committed Apr 17, 2020
commit 2864266767a183674896505a553d9da0a77a454d
4 changes: 4 additions & 0 deletions test/Neuron/Zettelkasten/QuerySpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ spec =
parseQueryString "zquery:https://search" `shouldBe` Right []
it "Parse single tag" $
parseQueryString "zquery:https://search?tag=foo" `shouldBe` Right [ByTag $ TagPattern "foo"]
it "Parse hierarchical tag" $ do
parseQueryString "zquery:https://search?tag=foo/bar" `shouldBe` Right [ByTag $ TagPattern "foo/bar"]
it "Parse tag pattern" $ do
parseQueryString "zquery:https://search?tag=foo/**/bar/*/baz" `shouldBe` Right [ByTag $ TagPattern "foo/**/bar/*/baz"]
it "Parse multiple tags" $
parseQueryString "zquery:https://search?tag=foo&tag=bar"
`shouldBe` Right [ByTag $ TagPattern "foo", ByTag $ TagPattern "bar"]
Expand Down