Skip to content

Commit 1c484d8

Browse files
committed
Ruby: add some calls to .each in call graph test
1 parent ab672de commit 1c484d8

File tree

3 files changed

+567
-528
lines changed

3 files changed

+567
-528
lines changed

ruby/ql/test/library-tests/modules/callgraph.expected

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ getTarget
202202
| calls.rb:523:1:523:23 | call to new | calls.rb:117:5:117:16 | new |
203203
| calls.rb:524:1:524:23 | call to new | calls.rb:117:5:117:16 | new |
204204
| calls.rb:524:1:524:27 | call to baz | calls.rb:516:5:519:7 | baz |
205+
| calls.rb:526:2:526:6 | call to new | calls.rb:117:5:117:16 | new |
205206
| hello.rb:12:5:12:24 | call to include | calls.rb:108:5:110:7 | include |
206207
| hello.rb:14:16:14:20 | call to hello | hello.rb:2:5:4:7 | hello |
207208
| hello.rb:20:16:20:20 | call to super | hello.rb:13:5:15:7 | message |
@@ -312,6 +313,12 @@ unresolvedCall
312313
| calls.rb:512:1:512:24 | call to bar |
313314
| calls.rb:522:1:522:27 | call to foo |
314315
| calls.rb:523:1:523:27 | call to bar |
316+
| calls.rb:526:1:526:7 | call to [] |
317+
| calls.rb:526:1:526:26 | call to each |
318+
| calls.rb:526:20:526:24 | call to baz |
319+
| calls.rb:527:1:527:13 | call to [] |
320+
| calls.rb:527:1:527:39 | call to each |
321+
| calls.rb:527:26:527:37 | call to capitalize |
315322
| hello.rb:20:16:20:26 | ... + ... |
316323
| hello.rb:20:16:20:34 | ... + ... |
317324
| hello.rb:20:16:20:40 | ... + ... |

ruby/ql/test/library-tests/modules/calls.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,3 +522,6 @@ def baz
522522
ProtectedMethodsSub.new.foo # NoMethodError
523523
ProtectedMethodsSub.new.bar # NoMethodError
524524
ProtectedMethodsSub.new.baz
525+
526+
[C.new].each { |c| c.baz }
527+
["a","b","c"].each { |s| s.capitalize }

0 commit comments

Comments
 (0)