From 4b9caec4c56347fb3a792716be1d3232ad457a90 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Wed, 4 Apr 2018 08:59:13 -0700 Subject: [PATCH] Fix up tests for Name wrapper --- test/Data/Functor/Listable.hs | 4 ++ test/Rendering/TOC/Spec.hs | 8 +-- .../go/binary-expressions.diffA-B.txt | 35 ++++++------ .../go/binary-expressions.diffB-A.txt | 25 ++++----- .../go/const-with-implicit-values.diffA-B.txt | 13 +++-- .../go/const-with-implicit-values.diffB-A.txt | 21 +++++--- .../grouped-import-declarations.diffA-B.txt | 16 +++--- .../grouped-import-declarations.diffB-A.txt | 16 +++--- .../go/single-import-declarations.diffA-B.txt | 24 ++++----- .../go/single-import-declarations.diffB-A.txt | 16 +++--- .../fixtures/go/slice-expressions.diffA-B.txt | 21 ++++---- .../fixtures/go/unary-expressions.diffA-B.txt | 54 ++++++++----------- .../fixtures/go/unary-expressions.diffB-A.txt | 54 ++++++++----------- test/fixtures/javascript/export.diffA-B.txt | 10 ++-- test/fixtures/javascript/export.diffB-A.txt | 13 ++--- test/fixtures/javascript/import.diffA-B.txt | 14 ++--- test/fixtures/javascript/import.diffB-A.txt | 12 ++--- test/fixtures/python/assignment.diffA-B.txt | 18 +++---- .../python/augmented-assignment.diffA-B.txt | 24 ++++----- .../python/augmented-assignment.diffB-A.txt | 34 ++++++------ .../python/comparison-operator.diffB-A.txt | 20 +++---- .../python/import-from-statement.diffB-A.txt | 4 +- test/fixtures/python/tuple.diffA-B.txt | 15 +++--- test/fixtures/python/tuple.diffB-A.txt | 14 ++--- test/fixtures/ruby/hash.diffA-B.txt | 33 ++++++------ test/fixtures/ruby/hash.diffB-A.txt | 26 +++++---- test/fixtures/typescript/export.diffA-B.txt | 10 ++-- test/fixtures/typescript/export.diffB-A.txt | 13 ++--- test/fixtures/typescript/import.diffA-B.txt | 14 ++--- test/fixtures/typescript/import.diffB-A.txt | 16 +++--- 30 files changed, 285 insertions(+), 312 deletions(-) diff --git a/test/Data/Functor/Listable.hs b/test/Data/Functor/Listable.hs index c571f25b1..344d6e671 100644 --- a/test/Data/Functor/Listable.hs +++ b/test/Data/Functor/Listable.hs @@ -47,6 +47,7 @@ import qualified Data.Syntax as Syntax import qualified Data.Syntax.Comment as Comment import qualified Data.Syntax.Declaration as Declaration import qualified Data.Syntax.Statement as Statement +import qualified Data.Abstract.FreeVariables as FV import Data.Term import Data.Text as T (Text, pack) import qualified Data.Text.Encoding as T @@ -256,6 +257,9 @@ type ListableSyntax = Union , [] ] +instance Listable FV.Name where + tiers = cons1 FV.name + instance Listable1 Gram where liftTiers tiers = liftCons2 (liftTiers (liftTiers tiers)) (liftTiers (liftTiers tiers)) Gram diff --git a/test/Rendering/TOC/Spec.hs b/test/Rendering/TOC/Spec.hs index e3d910192..71bd012dd 100644 --- a/test/Rendering/TOC/Spec.hs +++ b/test/Rendering/TOC/Spec.hs @@ -166,14 +166,14 @@ programWithChange :: Term' -> Diff' programWithChange body = merge (programInfo, programInfo) (inj [ function' ]) where function' = merge (Just (FunctionDeclaration "foo" mempty Nothing) :. emptyInfo, Just (FunctionDeclaration "foo" mempty Nothing) :. emptyInfo) (inj (Declaration.Function [] name' [] (merge (Nothing :. emptyInfo, Nothing :. emptyInfo) (inj [ inserting body ])))) - name' = let info = Nothing :. emptyInfo in merge (info, info) (inj (Syntax.Identifier "foo")) + name' = let info = Nothing :. emptyInfo in merge (info, info) (inj (Syntax.Identifier (name "foo"))) -- Return a diff where term is inserted in the program, below a function found on both sides of the diff. programWithChangeOutsideFunction :: Term' -> Diff' programWithChangeOutsideFunction term = merge (programInfo, programInfo) (inj [ function', term' ]) where function' = merge (Just (FunctionDeclaration "foo" mempty Nothing) :. emptyInfo, Just (FunctionDeclaration "foo" mempty Nothing) :. emptyInfo) (inj (Declaration.Function [] name' [] (merge (Nothing :. emptyInfo, Nothing :. emptyInfo) (inj [])))) - name' = let info = Nothing :. emptyInfo in merge (info, info) (inj (Syntax.Identifier "foo")) + name' = let info = Nothing :. emptyInfo in merge (info, info) (inj (Syntax.Identifier (name "foo"))) term' = inserting term programWithInsert :: Text -> Term' -> Diff' @@ -191,7 +191,7 @@ programOf diff = merge (programInfo, programInfo) (inj [ diff ]) functionOf :: Text -> Term' -> Term' functionOf n body = termIn (Just (FunctionDeclaration n mempty Nothing) :. emptyInfo) (inj (Declaration.Function [] name' [] (termIn (Nothing :. emptyInfo) (inj [body])))) where - name' = termIn (Nothing :. emptyInfo) (inj (Syntax.Identifier (encodeUtf8 n))) + name' = termIn (Nothing :. emptyInfo) (inj (Syntax.Identifier (name (encodeUtf8 n)))) programInfo :: Record '[Maybe Declaration, Range, Span] programInfo = Nothing :. emptyInfo @@ -218,7 +218,7 @@ blobsForPaths :: Both FilePath -> IO BlobPair blobsForPaths = readFilePair . fmap ("test/fixtures/toc/" <>) blankDiff :: Diff' -blankDiff = merge (arrayInfo, arrayInfo) (inj [ inserting (termIn literalInfo (inj (Syntax.Identifier "\"a\""))) ]) +blankDiff = merge (arrayInfo, arrayInfo) (inj [ inserting (termIn literalInfo (inj (Syntax.Identifier (name "\"a\"")))) ]) where arrayInfo = Nothing :. Range 0 3 :. Span (Pos 1 1) (Pos 1 5) :. Nil literalInfo = Nothing :. Range 1 2 :. Span (Pos 1 2) (Pos 1 4) :. Nil diff --git a/test/fixtures/go/binary-expressions.diffA-B.txt b/test/fixtures/go/binary-expressions.diffA-B.txt index 56cd0240b..94735c26b 100644 --- a/test/fixtures/go/binary-expressions.diffA-B.txt +++ b/test/fixtures/go/binary-expressions.diffA-B.txt @@ -27,19 +27,26 @@ ->(Identifier) } { (Identifier) ->(Identifier) }) - {+(Not - {+(Equal - {+(Identifier)+} - {+(Identifier)+})+})+} - {+(LessThan - {+(Identifier)+} - {+(Identifier)+})+} + (Not + (Equal + { (Identifier) + ->(Identifier) } + { (Identifier) + ->(Identifier) })) + (LessThan + { (Identifier) + ->(Identifier) } + { (Identifier) + ->(Identifier) }) {+(LessThanEqual {+(Identifier)+} {+(Identifier)+})+} - {+(GreaterThan + { (LessThanEqual + {-(Identifier)-} + {-(Identifier)-}) + ->(GreaterThan {+(Identifier)+} - {+(Identifier)+})+} + {+(Identifier)+}) } {+(GreaterThanEqual {+(Identifier)+} {+(Identifier)+})+} @@ -76,16 +83,6 @@ {+(BAnd {+(Identifier)+} {+(Identifier)+})+} - {-(Not - {-(Equal - {-(Identifier)-} - {-(Identifier)-})-})-} - {-(LessThan - {-(Identifier)-} - {-(Identifier)-})-} - {-(LessThanEqual - {-(Identifier)-} - {-(Identifier)-})-} {-(GreaterThan {-(Identifier)-} {-(Identifier)-})-} diff --git a/test/fixtures/go/binary-expressions.diffB-A.txt b/test/fixtures/go/binary-expressions.diffB-A.txt index 56cd0240b..747bd93a8 100644 --- a/test/fixtures/go/binary-expressions.diffB-A.txt +++ b/test/fixtures/go/binary-expressions.diffB-A.txt @@ -27,13 +27,17 @@ ->(Identifier) } { (Identifier) ->(Identifier) }) - {+(Not - {+(Equal - {+(Identifier)+} - {+(Identifier)+})+})+} - {+(LessThan - {+(Identifier)+} - {+(Identifier)+})+} + (Not + (Equal + { (Identifier) + ->(Identifier) } + { (Identifier) + ->(Identifier) })) + (LessThan + { (Identifier) + ->(Identifier) } + { (Identifier) + ->(Identifier) }) {+(LessThanEqual {+(Identifier)+} {+(Identifier)+})+} @@ -76,13 +80,6 @@ {+(BAnd {+(Identifier)+} {+(Identifier)+})+} - {-(Not - {-(Equal - {-(Identifier)-} - {-(Identifier)-})-})-} - {-(LessThan - {-(Identifier)-} - {-(Identifier)-})-} {-(LessThanEqual {-(Identifier)-} {-(Identifier)-})-} diff --git a/test/fixtures/go/const-with-implicit-values.diffA-B.txt b/test/fixtures/go/const-with-implicit-values.diffA-B.txt index c24647f41..536258191 100644 --- a/test/fixtures/go/const-with-implicit-values.diffA-B.txt +++ b/test/fixtures/go/const-with-implicit-values.diffA-B.txt @@ -6,15 +6,18 @@ (Identifier) ([]) ( + {+(Assignment + {+(Identifier)+} + {+(Identifier)+})+} (Assignment { (Identifier) ->(Identifier) } - (Identifier)) + { (Identifier) + ->([]) }) (Assignment { (Identifier) ->(Identifier) } ([])) - (Assignment - { (Identifier) - ->(Identifier) } - ([]))))) + {-(Assignment + {-(Identifier)-} + {-([])-})-}))) diff --git a/test/fixtures/go/const-with-implicit-values.diffB-A.txt b/test/fixtures/go/const-with-implicit-values.diffB-A.txt index c24647f41..20efc4b51 100644 --- a/test/fixtures/go/const-with-implicit-values.diffB-A.txt +++ b/test/fixtures/go/const-with-implicit-values.diffB-A.txt @@ -6,15 +6,20 @@ (Identifier) ([]) ( + {+(Assignment + {+(Identifier)+} + {+(Identifier)+})+} (Assignment { (Identifier) ->(Identifier) } - (Identifier)) - (Assignment { (Identifier) - ->(Identifier) } - ([])) - (Assignment - { (Identifier) - ->(Identifier) } - ([]))))) + ->([]) }) + {+(Assignment + {+(Identifier)+} + {+([])+})+} + {-(Assignment + {-(Identifier)-} + {-([])-})-} + {-(Assignment + {-(Identifier)-} + {-([])-})-}))) diff --git a/test/fixtures/go/grouped-import-declarations.diffA-B.txt b/test/fixtures/go/grouped-import-declarations.diffA-B.txt index a311b847e..e36dffe71 100644 --- a/test/fixtures/go/grouped-import-declarations.diffA-B.txt +++ b/test/fixtures/go/grouped-import-declarations.diffA-B.txt @@ -2,18 +2,18 @@ (Package (Identifier)) ( + {+(QualifiedImport + {+(Identifier)+})+} + {+(Import + {+(TextElement)+})+} { (QualifiedImport {-(Identifier)-}) ->(QualifiedImport {+(Identifier)+}) } - { (Import - {-(TextElement)-}) - ->(Import - {+(TextElement)+}) } - { (QualifiedImport - {-(Identifier)-}) - ->(QualifiedImport - {+(Identifier)+}) }) + {-(Import + {-(TextElement)-})-} + {-(QualifiedImport + {-(Identifier)-})-}) (Function (Empty) (Identifier) diff --git a/test/fixtures/go/grouped-import-declarations.diffB-A.txt b/test/fixtures/go/grouped-import-declarations.diffB-A.txt index a311b847e..e36dffe71 100644 --- a/test/fixtures/go/grouped-import-declarations.diffB-A.txt +++ b/test/fixtures/go/grouped-import-declarations.diffB-A.txt @@ -2,18 +2,18 @@ (Package (Identifier)) ( + {+(QualifiedImport + {+(Identifier)+})+} + {+(Import + {+(TextElement)+})+} { (QualifiedImport {-(Identifier)-}) ->(QualifiedImport {+(Identifier)+}) } - { (Import - {-(TextElement)-}) - ->(Import - {+(TextElement)+}) } - { (QualifiedImport - {-(Identifier)-}) - ->(QualifiedImport - {+(Identifier)+}) }) + {-(Import + {-(TextElement)-})-} + {-(QualifiedImport + {-(Identifier)-})-}) (Function (Empty) (Identifier) diff --git a/test/fixtures/go/single-import-declarations.diffA-B.txt b/test/fixtures/go/single-import-declarations.diffA-B.txt index 708a431ba..6e0ecab67 100644 --- a/test/fixtures/go/single-import-declarations.diffA-B.txt +++ b/test/fixtures/go/single-import-declarations.diffA-B.txt @@ -1,18 +1,18 @@ (Program (Package (Identifier)) -{ (QualifiedImport - {-(Identifier)-}) -->(QualifiedImport - {+(Identifier)+}) } -{ (Import - {-(TextElement)-}) -->(Import - {+(TextElement)+}) } -{ (QualifiedImport - {-(Identifier)-}) -->(QualifiedImport - {+(Identifier)+}) } +{+(QualifiedImport + {+(Identifier)+})+} +{+(Import + {+(TextElement)+})+} +{+(QualifiedImport + {+(Identifier)+})+} +{-(QualifiedImport + {-(Identifier)-})-} +{-(Import + {-(TextElement)-})-} +{-(QualifiedImport + {-(Identifier)-})-} (Function (Empty) (Identifier) diff --git a/test/fixtures/go/single-import-declarations.diffB-A.txt b/test/fixtures/go/single-import-declarations.diffB-A.txt index 708a431ba..4d5a864f7 100644 --- a/test/fixtures/go/single-import-declarations.diffB-A.txt +++ b/test/fixtures/go/single-import-declarations.diffB-A.txt @@ -1,18 +1,18 @@ (Program (Package (Identifier)) +{+(QualifiedImport + {+(Identifier)+})+} +{+(Import + {+(TextElement)+})+} { (QualifiedImport {-(Identifier)-}) ->(QualifiedImport {+(Identifier)+}) } -{ (Import - {-(TextElement)-}) -->(Import - {+(TextElement)+}) } -{ (QualifiedImport - {-(Identifier)-}) -->(QualifiedImport - {+(Identifier)+}) } +{-(Import + {-(TextElement)-})-} +{-(QualifiedImport + {-(Identifier)-})-} (Function (Empty) (Identifier) diff --git a/test/fixtures/go/slice-expressions.diffA-B.txt b/test/fixtures/go/slice-expressions.diffA-B.txt index 0c1ba8d4f..6dbaf1a84 100644 --- a/test/fixtures/go/slice-expressions.diffA-B.txt +++ b/test/fixtures/go/slice-expressions.diffA-B.txt @@ -11,11 +11,14 @@ {+(Integer)+} {+(Empty)+} {+(Empty)+})+} - {+(Slice - {+(Identifier)+} - {+(Empty)+} - {+(Integer)+} - {+(Empty)+})+} + (Slice + { (Identifier) + ->(Identifier) } + { (Integer) + ->(Empty) } + { (Empty) + ->(Integer) } + (Empty)) {+(Slice {+(Identifier)+} {+(Integer)+} @@ -24,9 +27,10 @@ (Slice { (Identifier) ->(Identifier) } - (Integer) { (Empty) ->(Integer) } + { (Integer) + ->(Integer) } { (Empty) ->(Integer) }) {+(Slice @@ -34,11 +38,6 @@ {+(Integer)+} {+(Integer)+} {+(Empty)+})+} - {-(Slice - {-(Identifier)-} - {-(Empty)-} - {-(Integer)-} - {-(Empty)-})-} {-(Slice {-(Identifier)-} {-(Empty)-} diff --git a/test/fixtures/go/unary-expressions.diffA-B.txt b/test/fixtures/go/unary-expressions.diffA-B.txt index d57a8ee1e..755b66ffd 100644 --- a/test/fixtures/go/unary-expressions.diffA-B.txt +++ b/test/fixtures/go/unary-expressions.diffA-B.txt @@ -8,35 +8,25 @@ ( { (Identifier) ->(Identifier) } - {+(Negate - {+(Identifier)+})+} - {+(Not - {+(ReceiveOperator - {+(Identifier)+})+})+} - {+(Pointer - {+(Call - {+(Identifier)+} - {+([])+} - {+(Empty)+})+})+} - {+(Complement - {+(Identifier)+})+} - {+(Reference - {+(Identifier)+})+} - {+(ReceiveOperator - {+(Identifier)+})+} - {-(Negate - {-(Identifier)-})-} - {-(Not - {-(ReceiveOperator - {-(Identifier)-})-})-} - {-(Pointer - {-(Call - {-(Identifier)-} - {-([])-} - {-(Empty)-})-})-} - {-(Complement - {-(Identifier)-})-} - {-(Reference - {-(Identifier)-})-} - {-(ReceiveOperator - {-(Identifier)-})-}))) + (Negate + { (Identifier) + ->(Identifier) }) + (Not + (ReceiveOperator + { (Identifier) + ->(Identifier) })) + (Pointer + (Call + { (Identifier) + ->(Identifier) } + ([]) + (Empty))) + (Complement + { (Identifier) + ->(Identifier) }) + (Reference + { (Identifier) + ->(Identifier) }) + (ReceiveOperator + { (Identifier) + ->(Identifier) })))) diff --git a/test/fixtures/go/unary-expressions.diffB-A.txt b/test/fixtures/go/unary-expressions.diffB-A.txt index d57a8ee1e..755b66ffd 100644 --- a/test/fixtures/go/unary-expressions.diffB-A.txt +++ b/test/fixtures/go/unary-expressions.diffB-A.txt @@ -8,35 +8,25 @@ ( { (Identifier) ->(Identifier) } - {+(Negate - {+(Identifier)+})+} - {+(Not - {+(ReceiveOperator - {+(Identifier)+})+})+} - {+(Pointer - {+(Call - {+(Identifier)+} - {+([])+} - {+(Empty)+})+})+} - {+(Complement - {+(Identifier)+})+} - {+(Reference - {+(Identifier)+})+} - {+(ReceiveOperator - {+(Identifier)+})+} - {-(Negate - {-(Identifier)-})-} - {-(Not - {-(ReceiveOperator - {-(Identifier)-})-})-} - {-(Pointer - {-(Call - {-(Identifier)-} - {-([])-} - {-(Empty)-})-})-} - {-(Complement - {-(Identifier)-})-} - {-(Reference - {-(Identifier)-})-} - {-(ReceiveOperator - {-(Identifier)-})-}))) + (Negate + { (Identifier) + ->(Identifier) }) + (Not + (ReceiveOperator + { (Identifier) + ->(Identifier) })) + (Pointer + (Call + { (Identifier) + ->(Identifier) } + ([]) + (Empty))) + (Complement + { (Identifier) + ->(Identifier) }) + (Reference + { (Identifier) + ->(Identifier) }) + (ReceiveOperator + { (Identifier) + ->(Identifier) })))) diff --git a/test/fixtures/javascript/export.diffA-B.txt b/test/fixtures/javascript/export.diffA-B.txt index 4e6aea904..c988c24cc 100644 --- a/test/fixtures/javascript/export.diffA-B.txt +++ b/test/fixtures/javascript/export.diffA-B.txt @@ -35,15 +35,15 @@ (Identifier) { (Empty) ->(Identifier) }) - {+(Assignment - {+(Empty)+} - {+(Identifier)+} - {+(Empty)+})+} (Assignment (Empty) { (Identifier) ->(Identifier) } - (Empty)))) + (Empty)) + {+(Assignment + {+(Empty)+} + {+(Identifier)+} + {+(Empty)+})+})) (DefaultExport { (Identifier) ->(Identifier) }) diff --git a/test/fixtures/javascript/export.diffB-A.txt b/test/fixtures/javascript/export.diffB-A.txt index c0d98eefd..a01398a7b 100644 --- a/test/fixtures/javascript/export.diffB-A.txt +++ b/test/fixtures/javascript/export.diffB-A.txt @@ -35,14 +35,11 @@ (Identifier) { (Identifier) ->(Empty) }) - {+(Assignment - {+(Empty)+} - {+(Identifier)+} - {+(Empty)+})+} - {-(Assignment - {-(Empty)-} - {-(Identifier)-} - {-(Empty)-})-} + (Assignment + (Empty) + { (Identifier) + ->(Identifier) } + (Empty)) {-(Assignment {-(Empty)-} {-(Identifier)-} diff --git a/test/fixtures/javascript/import.diffA-B.txt b/test/fixtures/javascript/import.diffA-B.txt index f71f00e51..c6a0b07ad 100644 --- a/test/fixtures/javascript/import.diffA-B.txt +++ b/test/fixtures/javascript/import.diffA-B.txt @@ -1,14 +1,11 @@ (Program -{ (Import) -->(Import) } -{ (QualifiedAliasedImport - {-(Identifier)-}) -->(QualifiedAliasedImport - {+(Identifier)+}) } +{+(Import)+} +{+(QualifiedAliasedImport + {+(Identifier)+})+} +{+(Import)+} {+(Import)+} { (Import) ->(Import) } -{+(Import)+} {+( {+(Import)+} {+(Import)+})+} @@ -17,6 +14,9 @@ {+(QualifiedAliasedImport {+(Identifier)+})+})+} {+(SideEffectImport)+} +{-(QualifiedAliasedImport + {-(Identifier)-})-} +{-(Import)-} {-(Import)-} {-(Import)-} {-( diff --git a/test/fixtures/javascript/import.diffB-A.txt b/test/fixtures/javascript/import.diffB-A.txt index e01092cdb..c6a0b07ad 100644 --- a/test/fixtures/javascript/import.diffB-A.txt +++ b/test/fixtures/javascript/import.diffB-A.txt @@ -1,10 +1,7 @@ (Program -{ (Import) -->(Import) } -{ (QualifiedAliasedImport - {-(Identifier)-}) -->(QualifiedAliasedImport - {+(Identifier)+}) } +{+(Import)+} +{+(QualifiedAliasedImport + {+(Identifier)+})+} {+(Import)+} {+(Import)+} { (Import) @@ -17,6 +14,9 @@ {+(QualifiedAliasedImport {+(Identifier)+})+})+} {+(SideEffectImport)+} +{-(QualifiedAliasedImport + {-(Identifier)-})-} +{-(Import)-} {-(Import)-} {-(Import)-} {-( diff --git a/test/fixtures/python/assignment.diffA-B.txt b/test/fixtures/python/assignment.diffA-B.txt index 2ce0aca2e..c1c74f5af 100644 --- a/test/fixtures/python/assignment.diffA-B.txt +++ b/test/fixtures/python/assignment.diffA-B.txt @@ -10,18 +10,14 @@ { (Identifier) ->(Identifier) } (Integer)) -{+(Assignment - {+(Identifier)+} - {+( - {+(Integer)+} - {+(Integer)+})+})+} -{-(Assignment - {-( + (Assignment + { ( {-(Identifier)-} - {-(Identifier)-})-} - {-( - {-(Integer)-} - {-(Integer)-})-})-} + {-(Identifier)-}) + ->(Identifier) } + ( + (Integer) + (Integer))) {-(Assignment {-(Identifier)-} {-( diff --git a/test/fixtures/python/augmented-assignment.diffA-B.txt b/test/fixtures/python/augmented-assignment.diffA-B.txt index 795ae8f24..2abc99677 100644 --- a/test/fixtures/python/augmented-assignment.diffA-B.txt +++ b/test/fixtures/python/augmented-assignment.diffA-B.txt @@ -7,21 +7,21 @@ ->(RShift {+(Identifier)+} {+(Integer)+}) }) -{+(Assignment - {+(Identifier)+} - {+(DividedBy - {+(Identifier)+} - {+(Integer)+})+})+} (Assignment - (Identifier) + { (Identifier) + ->(Identifier) } { (RShift {-(Identifier)-} {-(Integer)-}) + ->(DividedBy + {+(Identifier)+} + {+(Integer)+}) }) + (Assignment + { (Identifier) + ->(Identifier) } + { (DividedBy + {-(Identifier)-} + {-(Integer)-}) ->(Plus {+(Identifier)+} - {+(Integer)+}) }) -{-(Assignment - {-(Identifier)-} - {-(DividedBy - {-(Identifier)-} - {-(Integer)-})-})-}) + {+(Integer)+}) })) diff --git a/test/fixtures/python/augmented-assignment.diffB-A.txt b/test/fixtures/python/augmented-assignment.diffB-A.txt index 6406e416d..07c8da605 100644 --- a/test/fixtures/python/augmented-assignment.diffB-A.txt +++ b/test/fixtures/python/augmented-assignment.diffB-A.txt @@ -7,23 +7,21 @@ ->(Plus {+(Identifier)+} {+(Integer)+}) }) -{+(Assignment - {+(Identifier)+} - {+(RShift - {+(Identifier)+} - {+(Integer)+})+})+} -{+(Assignment - {+(Identifier)+} - {+(DividedBy - {+(Identifier)+} - {+(Integer)+})+})+} -{-(Assignment - {-(Identifier)-} - {-(DividedBy + (Assignment + { (Identifier) + ->(Identifier) } + { (DividedBy {-(Identifier)-} - {-(Integer)-})-})-} -{-(Assignment - {-(Identifier)-} - {-(Plus + {-(Integer)-}) + ->(RShift + {+(Identifier)+} + {+(Integer)+}) }) + (Assignment + { (Identifier) + ->(Identifier) } + { (Plus {-(Identifier)-} - {-(Integer)-})-})-}) + {-(Integer)-}) + ->(DividedBy + {+(Identifier)+} + {+(Integer)+}) })) diff --git a/test/fixtures/python/comparison-operator.diffB-A.txt b/test/fixtures/python/comparison-operator.diffB-A.txt index 9d0315fea..1d8636d90 100644 --- a/test/fixtures/python/comparison-operator.diffB-A.txt +++ b/test/fixtures/python/comparison-operator.diffB-A.txt @@ -5,22 +5,22 @@ {+(LessThanEqual {+(Identifier)+} {+(Identifier)+})+} +{+(Not + {+(Equal + {+(Identifier)+} + {+(Identifier)+})+})+} +{+(GreaterThanEqual + {+(Identifier)+} + {+(Identifier)+})+} +{+(GreaterThan + {+(Identifier)+} + {+(Identifier)+})+} (Not (Equal { (Identifier) ->(Identifier) } { (Identifier) ->(Identifier) })) -{+(GreaterThanEqual - {+(Identifier)+} - {+(Identifier)+})+} -{+(GreaterThan - {+(Identifier)+} - {+(Identifier)+})+} -{+(Not - {+(Equal - {+(Identifier)+} - {+(Identifier)+})+})+} {+(Member {+(Identifier)+} {+(Identifier)+})+} diff --git a/test/fixtures/python/import-from-statement.diffB-A.txt b/test/fixtures/python/import-from-statement.diffB-A.txt index 605c0562c..994ec1050 100644 --- a/test/fixtures/python/import-from-statement.diffB-A.txt +++ b/test/fixtures/python/import-from-statement.diffB-A.txt @@ -3,10 +3,10 @@ {+(Import)+} { (Import) ->(Import) } -{ (Import) -->(Import) } +{+(Import)+} {+(Import)+} {-(Import)-} {-(Import)-} {-(Import)-} +{-(Import)-} {-(Import)-}) diff --git a/test/fixtures/python/tuple.diffA-B.txt b/test/fixtures/python/tuple.diffA-B.txt index d0fdb2952..f82c12c36 100644 --- a/test/fixtures/python/tuple.diffA-B.txt +++ b/test/fixtures/python/tuple.diffA-B.txt @@ -1,11 +1,14 @@ (Program - (Tuple - {-(Identifier)-} - (Identifier) +{+(Tuple {+(Identifier)+} - {+(Identifier)+}) + {+(Identifier)+} + {+(Identifier)+})+} (Tuple {-(Identifier)-} (Identifier) - (Identifier)) -{+(Identifier)+}) + {+(Identifier)+}) +{+(Identifier)+} +{-(Tuple + {-(Identifier)-} + {-(Identifier)-} + {-(Identifier)-})-}) diff --git a/test/fixtures/python/tuple.diffB-A.txt b/test/fixtures/python/tuple.diffB-A.txt index 2418ffb6a..ea966d496 100644 --- a/test/fixtures/python/tuple.diffB-A.txt +++ b/test/fixtures/python/tuple.diffB-A.txt @@ -1,11 +1,13 @@ (Program - (Tuple - {-(Identifier)-} - {-(Identifier)-} - (Identifier) - {+(Identifier)+}) +{+(Tuple + {+(Identifier)+} + {+(Identifier)+})+} (Tuple {+(Identifier)+} (Identifier) - (Identifier)) + (Identifier) + {-(Identifier)-}) +{-(Tuple + {-(Identifier)-} + {-(Identifier)-})-} {-(Identifier)-}) diff --git a/test/fixtures/ruby/hash.diffA-B.txt b/test/fixtures/ruby/hash.diffA-B.txt index 6cd824ce2..6294f4491 100644 --- a/test/fixtures/ruby/hash.diffA-B.txt +++ b/test/fixtures/ruby/hash.diffA-B.txt @@ -1,23 +1,20 @@ (Program (Hash - {+(KeyValue - {+(Identifier)+} - {+(TextElement)+})+} - {+(KeyValue - {+(Identifier)+} - {+(Integer)+})+} - {+(KeyValue - {+(Identifier)+} - {+(Boolean)+})+} - {-(KeyValue - {-(Symbol)-} - {-(TextElement)-})-} - {-(KeyValue - {-(Symbol)-} - {-(Integer)-})-} - {-(KeyValue - {-(TextElement)-} - {-(Boolean)-})-} + (KeyValue + { (Symbol) + ->(Identifier) } + { (TextElement) + ->(TextElement) }) + (KeyValue + { (Symbol) + ->(Identifier) } + { (Integer) + ->(Integer) }) + (KeyValue + { (TextElement) + ->(Identifier) } + { (Boolean) + ->(Boolean) }) {-(KeyValue {-(Symbol)-} {-(Integer)-})-}) diff --git a/test/fixtures/ruby/hash.diffB-A.txt b/test/fixtures/ruby/hash.diffB-A.txt index 699a68a15..7b1ca75c0 100644 --- a/test/fixtures/ruby/hash.diffB-A.txt +++ b/test/fixtures/ruby/hash.diffB-A.txt @@ -1,25 +1,23 @@ (Program (Hash - {+(KeyValue - {+(Symbol)+} - {+(TextElement)+})+} - {+(KeyValue - {+(Symbol)+} - {+(Integer)+})+} + (KeyValue + { (Identifier) + ->(Symbol) } + { (TextElement) + ->(TextElement) }) + (KeyValue + { (Identifier) + ->(Symbol) } + { (Integer) + ->(Integer) }) (KeyValue { (Identifier) ->(TextElement) } - { (TextElement) + { (Boolean) ->(Boolean) }) {+(KeyValue {+(Symbol)+} - {+(Integer)+})+} - {-(KeyValue - {-(Identifier)-} - {-(Integer)-})-} - {-(KeyValue - {-(Identifier)-} - {-(Boolean)-})-}) + {+(Integer)+})+}) {+(Hash)+} {+(Hash {+(Context diff --git a/test/fixtures/typescript/export.diffA-B.txt b/test/fixtures/typescript/export.diffA-B.txt index 4e6aea904..c988c24cc 100644 --- a/test/fixtures/typescript/export.diffA-B.txt +++ b/test/fixtures/typescript/export.diffA-B.txt @@ -35,15 +35,15 @@ (Identifier) { (Empty) ->(Identifier) }) - {+(Assignment - {+(Empty)+} - {+(Identifier)+} - {+(Empty)+})+} (Assignment (Empty) { (Identifier) ->(Identifier) } - (Empty)))) + (Empty)) + {+(Assignment + {+(Empty)+} + {+(Identifier)+} + {+(Empty)+})+})) (DefaultExport { (Identifier) ->(Identifier) }) diff --git a/test/fixtures/typescript/export.diffB-A.txt b/test/fixtures/typescript/export.diffB-A.txt index c0d98eefd..a01398a7b 100644 --- a/test/fixtures/typescript/export.diffB-A.txt +++ b/test/fixtures/typescript/export.diffB-A.txt @@ -35,14 +35,11 @@ (Identifier) { (Identifier) ->(Empty) }) - {+(Assignment - {+(Empty)+} - {+(Identifier)+} - {+(Empty)+})+} - {-(Assignment - {-(Empty)-} - {-(Identifier)-} - {-(Empty)-})-} + (Assignment + (Empty) + { (Identifier) + ->(Identifier) } + (Empty)) {-(Assignment {-(Empty)-} {-(Identifier)-} diff --git a/test/fixtures/typescript/import.diffA-B.txt b/test/fixtures/typescript/import.diffA-B.txt index 9fa79264e..d09595a71 100644 --- a/test/fixtures/typescript/import.diffA-B.txt +++ b/test/fixtures/typescript/import.diffA-B.txt @@ -1,14 +1,11 @@ (Program -{ (Import) -->(Import) } -{ (QualifiedAliasedImport - {-(Identifier)-}) -->(QualifiedAliasedImport - {+(Identifier)+}) } +{+(Import)+} +{+(QualifiedAliasedImport + {+(Identifier)+})+} +{+(Import)+} {+(Import)+} { (Import) ->(Import) } -{+(Import)+} {+( {+(Import)+} {+(Import)+})+} @@ -17,6 +14,9 @@ {+(QualifiedAliasedImport {+(Identifier)+})+})+} {+(SideEffectImport)+} +{-(QualifiedAliasedImport + {-(Identifier)-})-} +{-(Import)-} {-(Import)-} {-(Import)-} {-( diff --git a/test/fixtures/typescript/import.diffB-A.txt b/test/fixtures/typescript/import.diffB-A.txt index 06ceabf25..cc6bed6ee 100644 --- a/test/fixtures/typescript/import.diffB-A.txt +++ b/test/fixtures/typescript/import.diffB-A.txt @@ -1,10 +1,7 @@ (Program -{ (Import) -->(Import) } -{ (QualifiedAliasedImport - {-(Identifier)-}) -->(QualifiedAliasedImport - {+(Identifier)+}) } +{+(Import)+} +{+(QualifiedAliasedImport + {+(Identifier)+})+} {+(Import)+} {+(Import)+} { (Import) @@ -17,8 +14,11 @@ {+(QualifiedAliasedImport {+(Identifier)+})+})+} {+(SideEffectImport)+} -{+(QualifiedAliasedImport - {+(Identifier)+})+} +{ (QualifiedAliasedImport + {-(Identifier)-}) +->(QualifiedAliasedImport + {+(Identifier)+}) } +{-(Import)-} {-(Import)-} {-(Import)-} {-(