1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

Kill verbatim, since we have more principled golden tests now.

This commit is contained in:
Patrick Thomson 2019-06-12 12:46:30 -04:00
parent 11442cf772
commit 14bbf6856b

View File

@ -10,8 +10,6 @@ module SpecHelpers
, runTaskOrDie
, TaskSession(..)
, testEvaluating
, verbatim
, Verbatim(..)
, toList
, Config
, LogQueue
@ -195,17 +193,3 @@ lookupDeclaration name (currentScope, currentFrame) heap scopeGraph = do
path <- ScopeGraph.lookupScopePath name currentScope scopeGraph
frameAddress <- Heap.lookupFrameAddress path currentFrame heap
toList <$> Heap.getSlotValue (Slot frameAddress (Heap.pathPosition path)) heap
newtype Verbatim = Verbatim ByteString
deriving (Eq)
instance Show Verbatim where
showsPrec _ (Verbatim byteString) = (T.unpack (T.decodeUtf8 byteString) ++)
verbatim :: ByteString -> Verbatim
verbatim = Verbatim . stripWhitespace
where
stripWhitespace :: ByteString -> ByteString
stripWhitespace = B.foldl' go B.empty
where go acc x | x `B.elem` " \t\n" = acc
| otherwise = B.snoc acc x