1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Fix tests to use Category instead of String

This commit is contained in:
Timothy Clem 2016-12-12 17:47:12 -08:00
parent 489ed112a0
commit 63def337ca

View File

@ -36,10 +36,10 @@ testDiff :: Diff (Syntax Text) (Record '[Category, Range, SourceSpan])
testDiff = free $ Free (pure arrayInfo :< Indexed [ free $ Pure (Insert (cofree $ literalInfo :< Leaf "\"a\"")) ])
testSummary :: DiffSummary DiffInfo
testSummary = DiffSummary { patch = Insert (LeafInfo "string" "a" $ sourceSpanBetween (1,1) (1, 2)), parentAnnotation = [] }
testSummary = DiffSummary { patch = Insert (LeafInfo Category.StringLiteral "a" $ sourceSpanBetween (1,1) (1, 2)), parentAnnotation = [] }
replacementSummary :: DiffSummary DiffInfo
replacementSummary = DiffSummary { patch = Replace (LeafInfo "string" "a" $ sourceSpanBetween (1, 2) (1, 4)) (LeafInfo "symbol" "b" $ sourceSpanBetween (1,1) (1, 2)), parentAnnotation = [Left (Info.FunctionCall, "foo")] }
replacementSummary = DiffSummary { patch = Replace (LeafInfo Category.StringLiteral "a" $ sourceSpanBetween (1, 2) (1, 4)) (LeafInfo Category.SymbolLiteral "b" $ sourceSpanBetween (1,1) (1, 2)), parentAnnotation = [Left (Info.FunctionCall, "foo")] }
blobs :: Both SourceBlob
blobs = both (SourceBlob (fromText "[]") nullOid "a.js" (Just defaultPlainBlob)) (SourceBlob (fromText "[a]") nullOid "b.js" (Just defaultPlainBlob))