mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 02:25:39 +03:00
fix html test, added a bit more diagnostics to searchengine.u
This commit is contained in:
parent
e640c59693
commit
69160d31ad
@ -33,7 +33,7 @@ getLinks s = mapMaybe sectionToLink . justAnchorSections $ parseTags s
|
||||
|
||||
toPlainText :: Text -> Text
|
||||
toPlainText s =
|
||||
Text.concat [headings s, Text.pack "\n", collapseSpaces . innerText . ignores $ parseTags s]
|
||||
collapseSpaces $ Text.concat [headings s, Text.pack "\n", innerText . ignores $ parseTags s]
|
||||
|
||||
collapseSpaces :: Text -> Text
|
||||
collapseSpaces t =
|
||||
|
@ -35,7 +35,7 @@ numlinks = let found = getLinks $ pack testHTML in if 3 == length found
|
||||
else fail $ "expected 3 links, got " ++ show found
|
||||
|
||||
plainText :: Assertion
|
||||
plainText = let expected = "simple linkInside one Inside other outside one inside list Empty link"
|
||||
plainText = let expected = "simple linkInside one Inside other outside one inside list Empty link"
|
||||
result = toPlainText $ pack testHTML
|
||||
in if expected == result
|
||||
then pure ()
|
||||
@ -55,7 +55,6 @@ run (codebase, parse, eval) = do
|
||||
desiredLinks = Term.vector [linkTerm]
|
||||
desiredHref = Term.text "link.html"
|
||||
desiredDescription = Term.text "description"
|
||||
-- todo: i am here, just need to replace this with calls to eval
|
||||
result = traverse eval [getLinksTerm, getLink, getDescription]
|
||||
evaluatedResult <- Note.unnote result
|
||||
|
||||
|
@ -117,8 +117,9 @@ let
|
||||
|
||||
-- Wait a while for crawlers to index a bunch of pages, then do query
|
||||
Remote.sleep (Duration.seconds 60);
|
||||
u = Debug.watch "done waiting for indexing, getting results" Unit;
|
||||
results := search 10 ["design", "unison"] ind;
|
||||
results := format-results results visited excerpts;
|
||||
results := format-results (Debug.watch "results !!!" results) visited excerpts;
|
||||
pure <| Debug.log results Unit results;;
|
||||
-- pure <| Debug.watch "results" results;;
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user