Skip to content

Commit a3d5506

Browse files
committed
Add test case
1 parent 0473a5f commit a3d5506

File tree

6 files changed

+16
-0
lines changed

6 files changed

+16
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2888,6 +2888,9 @@ operations/operations.rb:
28882888
# 104| getElement: [IntegerLiteral] 1
28892889
# 104| getElement: [IntegerLiteral] 2
28902890
# 104| getElement: [IntegerLiteral] 3
2891+
# 106| getStmt: [DivExpr] ... / ...
2892+
# 106| getAnOperand/getLeftOperand/getReceiver: [LocalVariableAccess] foo
2893+
# 107| getAnOperand/getArgument/getRightOperand: [IntegerLiteral] 5
28912894
params/params.rb:
28922895
# 1| [Toplevel] params.rb
28932896
# 4| getStmt: [Method] identifier_method_params

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5636,6 +5636,10 @@ operations/operations.rb:
56365636
# 104| 4: [ReservedWord] ,
56375637
# 104| 5: [Integer] 3
56385638
# 104| 6: [ReservedWord] ]
5639+
# 106| 73: [Binary] Binary
5640+
# 106| 0: [Identifier] foo
5641+
# 106| 1: [ReservedWord] /
5642+
# 107| 2: [Integer] 5
56395643
# 1| [Comment] # Start with assignments to all the identifiers used below, so that they are
56405644
# 2| [Comment] # interpreted as variables.
56415645
# 22| [Comment] # Unary operations

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ exprValue
921921
| operations/operations.rb:104:25:104:25 | 1 | 1 | int |
922922
| operations/operations.rb:104:28:104:28 | 2 | 2 | int |
923923
| operations/operations.rb:104:31:104:31 | 3 | 3 | int |
924+
| operations/operations.rb:107:1:107:1 | 5 | 5 | int |
924925
| params/params.rb:41:46:41:46 | 7 | 7 | int |
925926
| params/params.rb:47:19:47:21 | :bar | :bar | symbol |
926927
| params/params.rb:47:24:47:24 | 2 | 2 | int |
@@ -1828,6 +1829,7 @@ exprCfgNodeValue
18281829
| operations/operations.rb:104:25:104:25 | 1 | 1 | int |
18291830
| operations/operations.rb:104:28:104:28 | 2 | 2 | int |
18301831
| operations/operations.rb:104:31:104:31 | 3 | 3 | int |
1832+
| operations/operations.rb:107:1:107:1 | 5 | 5 | int |
18311833
| params/params.rb:41:46:41:46 | 7 | 7 | int |
18321834
| params/params.rb:47:19:47:21 | :bar | :bar | symbol |
18331835
| params/params.rb:47:24:47:24 | 2 | 2 | int |

ruby/ql/test/library-tests/ast/operations/binary.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ binaryOperations
4545
| operations.rb:101:21:101:23 | ... \|\| ... | \|\| | operations.rb:101:1:101:19 | MemberConstant | operations.rb:101:25:101:25 | 8 | LogicalOrExpr |
4646
| operations.rb:102:27:102:29 | ... \|\| ... | \|\| | operations.rb:102:1:102:25 | OtherConstant | operations.rb:102:31:102:31 | 7 | LogicalOrExpr |
4747
| operations.rb:103:13:103:15 | ... \|\| ... | \|\| | operations.rb:103:1:103:11 | CONSTANT4 | operations.rb:103:17:103:17 | 7 | LogicalOrExpr |
48+
| operations.rb:106:1:107:1 | ... / ... | / | operations.rb:106:1:106:3 | foo | operations.rb:107:1:107:1 | 5 | DivExpr |
4849
binaryArithmeticOperations
4950
| operations.rb:32:1:32:7 | ... + ... | + | operations.rb:32:1:32:1 | w | operations.rb:32:5:32:7 | 234 | AddExpr |
5051
| operations.rb:33:1:33:6 | ... - ... | - | operations.rb:33:1:33:1 | x | operations.rb:33:5:33:6 | 17 | SubExpr |
@@ -62,6 +63,7 @@ binaryArithmeticOperations
6263
| operations.rb:92:7:92:8 | ... / ... | / | operations.rb:92:3:92:5 | @@y | operations.rb:92:10:92:10 | 4 | DivExpr |
6364
| operations.rb:96:13:96:14 | ... * ... | * | operations.rb:96:1:96:11 | $global_var | operations.rb:96:16:96:16 | 6 | MulExpr |
6465
| operations.rb:99:11:99:12 | ... + ... | + | operations.rb:99:1:99:9 | CONSTANT2 | operations.rb:99:14:99:14 | 6 | AddExpr |
66+
| operations.rb:106:1:107:1 | ... / ... | / | operations.rb:106:1:106:3 | foo | operations.rb:107:1:107:1 | 5 | DivExpr |
6567
binaryLogicalOperations
6668
| operations.rb:40:1:40:10 | ... && ... | && | operations.rb:40:1:40:3 | foo | operations.rb:40:8:40:10 | bar | LogicalAndExpr |
6769
| operations.rb:41:1:41:11 | ... and ... | and | operations.rb:41:1:41:3 | baz | operations.rb:41:9:41:11 | qux | LogicalAndExpr |

ruby/ql/test/library-tests/ast/operations/operation.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,5 @@
243243
| operations.rb:104:24:104:32 | * ... | * | operations.rb:104:24:104:32 | [...] | SplatExpr |
244244
| operations.rb:104:24:104:32 | ... = ... | = | operations.rb:104:24:104:32 | * ... | AssignExpr |
245245
| operations.rb:104:24:104:32 | ... = ... | = | operations.rb:104:24:104:32 | __synth__3 | AssignExpr |
246+
| operations.rb:106:1:107:1 | ... / ... | / | operations.rb:106:1:106:3 | foo | DivExpr |
247+
| operations.rb:106:1:107:1 | ... / ... | / | operations.rb:107:1:107:1 | 5 | DivExpr |

ruby/ql/test/library-tests/ast/operations/operations.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,6 @@ class X
102102
foo(1).bar::OtherConstant ||= 7
103103
::CONSTANT4 ||= 7
104104
FOO, ::BAR, foo::FOO = [1, 2, 3]
105+
106+
foo /
107+
5

0 commit comments

Comments
 (0)