Skip to content

Commit 1fa2144

Browse files
committed
Ruby: Update test fixtures
1 parent 49aab51 commit 1fa2144

File tree

4 files changed

+99
-0
lines changed

4 files changed

+99
-0
lines changed

ruby/ql/test/library-tests/ast/Ast.expected

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,35 @@ constants/constants.rb:
15561556
# 73| getAnOperand/getLeftOperand: [ClassVariableAccess] @@fourty_six
15571557
# 73| getAnOperand/getRightOperand: [ConstantReadAccess] FOURTY_SIX
15581558
# 73| getScopeExpr: [ConstantReadAccess] Mod3
1559+
# 78| getStmt: [AssignExpr] ... = ...
1560+
# 78| getAnOperand/getLeftOperand: [LocalVariableAccess] a
1561+
# 78| getAnOperand/getRightOperand: [ArrayLiteral] [...]
1562+
# 78| getElement: [IntegerLiteral] 1
1563+
# 78| getElement: [IntegerLiteral] 2
1564+
# 78| getElement: [IntegerLiteral] 3
1565+
# 79| getStmt: [AssignExpr] ... = ...
1566+
# 79| getAnOperand/getLeftOperand: [ConstantAssignment] A
1567+
# 79| getAnOperand/getRightOperand: [ArrayLiteral] [...]
1568+
# 79| getElement: [IntegerLiteral] 1
1569+
# 79| getElement: [IntegerLiteral] 2
1570+
# 79| getElement: [IntegerLiteral] 3
1571+
# 80| getStmt: [AssignExpr] ... = ...
1572+
# 80| getAnOperand/getLeftOperand: [ConstantAssignment] B
1573+
# 80| getAnOperand/getRightOperand: [LocalVariableAccess] a
1574+
# 81| getStmt: [AssignExpr] ... = ...
1575+
# 81| getAnOperand/getLeftOperand: [ConstantAssignment] C
1576+
# 81| getAnOperand/getRightOperand: [ConstantReadAccess] A
1577+
# 82| getStmt: [AssignExpr] ... = ...
1578+
# 82| getAnOperand/getLeftOperand: [LocalVariableAccess] b
1579+
# 82| getAnOperand/getRightOperand: [ConstantReadAccess] B
1580+
# 84| getStmt: [IfExpr] if ...
1581+
# 84| getCondition: [MethodCall] call to condition
1582+
# 84| getReceiver: [SelfVariableAccess] self
1583+
# 84| getBranch/getThen: [StmtSequence] then ...
1584+
# 85| getStmt: [AssignExpr] ... = ...
1585+
# 85| getAnOperand/getLeftOperand: [LocalVariableAccess] c
1586+
# 85| getAnOperand/getRightOperand: [LocalVariableAccess] b
1587+
# 87| getStmt: [LocalVariableAccess] c
15591588
escape_sequences/escapes.rb:
15601589
# 1| [Toplevel] escapes.rb
15611590
# 6| getStmt: [StringLiteral] "\'"

ruby/ql/test/library-tests/ast/AstDesugar.expected

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,18 @@ constants/constants.rb:
336336
# 20| getComponent: [StringTextComponent] Chuck
337337
# 20| getArgument: [StringLiteral] "Dave"
338338
# 20| getComponent: [StringTextComponent] Dave
339+
# 78| [ArrayLiteral] [...]
340+
# 78| getDesugared: [MethodCall] call to []
341+
# 78| getReceiver: [ConstantReadAccess] Array
342+
# 78| getArgument: [IntegerLiteral] 1
343+
# 78| getArgument: [IntegerLiteral] 2
344+
# 78| getArgument: [IntegerLiteral] 3
345+
# 79| [ArrayLiteral] [...]
346+
# 79| getDesugared: [MethodCall] call to []
347+
# 79| getReceiver: [ConstantReadAccess] Array
348+
# 79| getArgument: [IntegerLiteral] 1
349+
# 79| getArgument: [IntegerLiteral] 2
350+
# 79| getArgument: [IntegerLiteral] 3
339351
escape_sequences/escapes.rb:
340352
# 58| [ArrayLiteral] %w(...)
341353
# 58| getDesugared: [MethodCall] call to []

ruby/ql/test/library-tests/ast/TreeSitter.expected

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,10 +1656,56 @@ constants/constants.rb:
16561656
# 73| 1: [ReservedWord] ::
16571657
# 73| 2: [Constant] FOURTY_SIX
16581658
# 74| 5: [ReservedWord] end
1659+
# 78| 13: [Assignment] Assignment
1660+
# 78| 0: [Identifier] a
1661+
# 78| 1: [ReservedWord] =
1662+
# 78| 2: [Array] Array
1663+
# 78| 0: [ReservedWord] [
1664+
# 78| 1: [Integer] 1
1665+
# 78| 2: [ReservedWord] ,
1666+
# 78| 3: [Integer] 2
1667+
# 78| 4: [ReservedWord] ,
1668+
# 78| 5: [Integer] 3
1669+
# 78| 6: [ReservedWord] ]
1670+
# 79| 14: [Assignment] Assignment
1671+
# 79| 0: [Constant] A
1672+
# 79| 1: [ReservedWord] =
1673+
# 79| 2: [Array] Array
1674+
# 79| 0: [ReservedWord] [
1675+
# 79| 1: [Integer] 1
1676+
# 79| 2: [ReservedWord] ,
1677+
# 79| 3: [Integer] 2
1678+
# 79| 4: [ReservedWord] ,
1679+
# 79| 5: [Integer] 3
1680+
# 79| 6: [ReservedWord] ]
1681+
# 80| 15: [Assignment] Assignment
1682+
# 80| 0: [Constant] B
1683+
# 80| 1: [ReservedWord] =
1684+
# 80| 2: [Identifier] a
1685+
# 81| 16: [Assignment] Assignment
1686+
# 81| 0: [Constant] C
1687+
# 81| 1: [ReservedWord] =
1688+
# 81| 2: [Constant] A
1689+
# 82| 17: [Assignment] Assignment
1690+
# 82| 0: [Identifier] b
1691+
# 82| 1: [ReservedWord] =
1692+
# 82| 2: [Constant] B
1693+
# 84| 18: [If] If
1694+
# 84| 0: [ReservedWord] if
1695+
# 84| 1: [Identifier] condition
1696+
# 84| 2: [Then] Then
1697+
# 85| 0: [Assignment] Assignment
1698+
# 85| 0: [Identifier] c
1699+
# 85| 1: [ReservedWord] =
1700+
# 85| 2: [Identifier] b
1701+
# 86| 3: [ReservedWord] end
1702+
# 87| 19: [Identifier] c
16591703
# 26| [Comment] # A call to Kernel::Array; despite beginning with an upper-case character,
16601704
# 27| [Comment] # we don't consider this to be a constant access.
16611705
# 55| [Comment] # refers to ::ModuleA::FOURTY_FOUR
16621706
# 57| [Comment] # refers to ::ModuleA::ModuleB::ClassB::FOURTY_FOUR
1707+
# 76| [Comment] # Array constants
1708+
# 87| [Comment] # not recognised
16631709
control/cases.rb:
16641710
# 1| [Program] Program
16651711
# 2| 0: [Assignment] Assignment

ruby/ql/test/library-tests/ast/ValueText.expected

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ exprValue
109109
| constants/constants.rb:63:19:63:20 | 45 | 45 | int |
110110
| constants/constants.rb:65:19:65:35 | FOURTY_FIVE | 45 | int |
111111
| constants/constants.rb:71:18:71:19 | 46 | 46 | int |
112+
| constants/constants.rb:78:6:78:6 | 1 | 1 | int |
113+
| constants/constants.rb:78:9:78:9 | 2 | 2 | int |
114+
| constants/constants.rb:78:12:78:12 | 3 | 3 | int |
115+
| constants/constants.rb:79:6:79:6 | 1 | 1 | int |
116+
| constants/constants.rb:79:9:79:9 | 2 | 2 | int |
117+
| constants/constants.rb:79:12:79:12 | 3 | 3 | int |
112118
| control/cases.rb:2:5:2:5 | 0 | 0 | int |
113119
| control/cases.rb:3:5:3:5 | 0 | 0 | int |
114120
| control/cases.rb:4:5:4:5 | 0 | 0 | int |
@@ -1004,6 +1010,12 @@ exprCfgNodeValue
10041010
| constants/constants.rb:63:19:63:20 | 45 | 45 | int |
10051011
| constants/constants.rb:65:19:65:35 | FOURTY_FIVE | 45 | int |
10061012
| constants/constants.rb:71:18:71:19 | 46 | 46 | int |
1013+
| constants/constants.rb:78:6:78:6 | 1 | 1 | int |
1014+
| constants/constants.rb:78:9:78:9 | 2 | 2 | int |
1015+
| constants/constants.rb:78:12:78:12 | 3 | 3 | int |
1016+
| constants/constants.rb:79:6:79:6 | 1 | 1 | int |
1017+
| constants/constants.rb:79:9:79:9 | 2 | 2 | int |
1018+
| constants/constants.rb:79:12:79:12 | 3 | 3 | int |
10071019
| control/cases.rb:2:5:2:5 | 0 | 0 | int |
10081020
| control/cases.rb:3:5:3:5 | 0 | 0 | int |
10091021
| control/cases.rb:4:5:4:5 | 0 | 0 | int |

0 commit comments

Comments
 (0)