Skip to content

Commit 546bfcb

Browse files
committed
Ruby: split tests to match stdlib changes
1 parent eb4f333 commit 546bfcb

21 files changed

+195
-174
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
subshellLiteralExecutions
2+
| Core.rb:1:1:1:10 | `echo foo` |
3+
| Core.rb:2:1:2:12 | `echo foo` |
4+
| Core.rb:3:1:3:12 | `echo foo` |
5+
| Core.rb:4:1:4:12 | `echo foo` |
6+
| Core.rb:5:1:5:12 | `echo foo` |
7+
subshellHeredocExecutions
8+
| Core.rb:7:1:7:7 | <<`EOF` |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import codeql.ruby.frameworks.Core
2+
import codeql.ruby.DataFlow
3+
4+
query predicate subshellLiteralExecutions(SubshellLiteralExecution e) { any() }
5+
6+
query predicate subshellHeredocExecutions(SubshellHeredocExecution e) { any() }

ruby/ql/test/library-tests/frameworks/Eval.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ def run
2121
end
2222

2323
Foo.new.send("exit", 1)
24-
Foo.new.instance_eval("self.class", "file.rb", 3)
25-
Foo.class_eval("def foo; 1; end", "file.rb", 1)
2624
Foo.module_eval("def bar; 1; end", "other_file.rb", 2)

ruby/ql/test/library-tests/frameworks/StandardLibrary.expected

Lines changed: 0 additions & 111 deletions
This file was deleted.

ruby/ql/test/library-tests/frameworks/StandardLibrary.ql

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
`echo foo`
2+
%x(echo foo)
3+
%x{echo foo}
4+
%x[echo foo]
5+
%x/echo foo/
6+
7+
<<`EOF`
8+
echo foo
9+
EOF
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| BasicObject.rb:1:1:1:49 | call to instance_eval | BasicObject.rb:1:23:1:34 | "self.class" |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import codeql.ruby.frameworks.core.BasicObject::BasicObject
2+
import codeql.ruby.DataFlow
3+
4+
query DataFlow::Node instanceEvalCallCodeExecutions(InstanceEvalCallCodeExecution e) {
5+
result = e.getCode()
6+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Foo.new.instance_eval("self.class", "file.rb", 3)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
kernelSystemCallExecutions
2+
| Kernel.rb:23:1:23:18 | call to system |
3+
| Kernel.rb:24:1:24:21 | call to system |
4+
| Kernel.rb:25:1:25:31 | call to system |
5+
| Kernel.rb:27:1:27:36 | call to system |
6+
| Kernel.rb:28:1:28:39 | call to system |
7+
| Kernel.rb:29:1:29:49 | call to system |
8+
| Kernel.rb:31:1:31:41 | call to system |
9+
| Kernel.rb:32:1:32:44 | call to system |
10+
| Kernel.rb:33:1:33:54 | call to system |
11+
| Kernel.rb:35:1:35:59 | call to system |
12+
| Kernel.rb:36:1:36:62 | call to system |
13+
| Kernel.rb:37:1:37:72 | call to system |
14+
kernelExecCallExecutions
15+
| Kernel.rb:39:1:39:16 | call to exec |
16+
| Kernel.rb:40:1:40:19 | call to exec |
17+
| Kernel.rb:41:1:41:29 | call to exec |
18+
| Kernel.rb:43:1:43:34 | call to exec |
19+
| Kernel.rb:44:1:44:37 | call to exec |
20+
| Kernel.rb:45:1:45:47 | call to exec |
21+
| Kernel.rb:47:1:47:39 | call to exec |
22+
| Kernel.rb:48:1:48:42 | call to exec |
23+
| Kernel.rb:49:1:49:52 | call to exec |
24+
| Kernel.rb:51:1:51:57 | call to exec |
25+
| Kernel.rb:52:1:52:60 | call to exec |
26+
| Kernel.rb:53:1:53:70 | call to exec |
27+
kernelSpawnCallExecutions
28+
| Kernel.rb:55:1:55:17 | call to spawn |
29+
| Kernel.rb:56:1:56:20 | call to spawn |
30+
| Kernel.rb:57:1:57:30 | call to spawn |
31+
| Kernel.rb:59:1:59:35 | call to spawn |
32+
| Kernel.rb:60:1:60:38 | call to spawn |
33+
| Kernel.rb:61:1:61:48 | call to spawn |
34+
| Kernel.rb:63:1:63:40 | call to spawn |
35+
| Kernel.rb:64:1:64:43 | call to spawn |
36+
| Kernel.rb:65:1:65:53 | call to spawn |
37+
| Kernel.rb:67:1:67:58 | call to spawn |
38+
| Kernel.rb:68:1:68:61 | call to spawn |
39+
| Kernel.rb:69:1:69:71 | call to spawn |
40+
sendCallCodeExecutions
41+
| Kernel.rb:2:1:2:22 | call to send | Kernel.rb:2:6:2:12 | "raise" |
42+
| Kernel.rb:5:1:5:19 | call to send | Kernel.rb:5:8:5:13 | "push" |
43+
evalCallCodeExecutions
44+
| Kernel.rb:1:1:1:43 | call to eval | Kernel.rb:1:6:1:22 | "raise \\"error\\"" |

0 commit comments

Comments
 (0)