1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Fix up specs

This commit is contained in:
Timothy Clem 2018-08-20 09:03:03 -07:00
parent 512ba1f8b6
commit 441c47f5ec

View File

@ -14,6 +14,7 @@ import Data.Sum
import Data.Foldable
import Semantic.IO
import Data.Blob
import Language.JSON.Translate
spec :: Spec
spec = describe "reprinting" $ do
@ -40,16 +41,16 @@ spec = describe "reprinting" $ do
describe "pipeline" $ do
it "should roundtrip exactly over a pristine tree" $ do
let tagged = mark Unmodified tree
let printed = runReprinter (Proxy @'Language.JSON) src tagged
let printed = runReprinter src defaultJSONPipeline tagged
printed `shouldBe` Right src
it "should roundtrip exactly over a wholly-modified tree" $ do
let tagged = mark Refactored tree
let printed = runReprinter (Proxy @'Language.JSON) src tagged
let printed = runReprinter src defaultJSONPipeline tagged
printed `shouldBe` Right src
it "should be able to parse the output of a refactor" $ do
let tagged = increaseNumbers (mark Refactored tree)
let (Right printed) = runReprinter (Proxy @'Language.JSON) src tagged
let (Right printed) = runReprinter src defaultJSONPipeline tagged
tree' <- runTask (parse jsonParser (Blob printed path Language.JSON))
length tree' `shouldSatisfy` (/= 0)