1{-# LANGUAGE OverloadedStrings #-}
3module Test.Highlights where
8import qualified Data.Map as M
10initHighlights :: Text -> BH IO (Either EsError (Maybe HitHighlight))
11initHighlights fieldName = do
14 let query = QueryMatchQuery $ mkMatchQuery (FieldName fieldName) (QueryString "haskell")
15 let testHighlight = Highlights Nothing [FieldHighlight (FieldName fieldName) Nothing]
16 let search = mkHighlightSearch (Just query) testHighlight
17 searchTweetHighlight search
21 describe "Highlights API" $ do
22 it "returns highlight from query when there should be one" $ withTestEnv $ do
23 myHighlight <- initHighlights "message"
25 myHighlight `shouldBe`
26 Right (Just (M.fromList [("message", ["Use <em>haskell</em>!"])]))
28 it "doesn't return highlight from a query when it shouldn't" $ withTestEnv $ do
29 myHighlight <- initHighlights "user"
31 myHighlight `shouldBe`
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list