Skip to content

Commit 08fa397

Browse files
committed
ruby: new rbi test case
1 parent 1af5c68 commit 08fa397

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

ruby/ql/test/library-tests/experimental/Rbi.expected

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ rbiTypes
3838
| test_types.rb:49:32:49:37 | String |
3939
| test_types.rb:49:40:49:45 | Symbol |
4040
| test_types.rb:49:57:49:62 | String |
41+
| test_types.rb:52:23:52:23 | T |
42+
| test_types.rb:52:23:52:32 | Boolean |
43+
| test_types.rb:52:43:52:43 | T |
44+
| test_types.rb:52:43:52:52 | Boolean |
4145
unionTypes
4246
| test_types.rb:49:26:49:46 | call to any | test_types.rb:49:32:49:37 | String |
4347
| test_types.rb:49:26:49:46 | call to any | test_types.rb:49:40:49:45 | Symbol |
@@ -61,6 +65,7 @@ signatureCalls
6165
| test_types.rb:38:14:38:19 | call to proc | String |
6266
| test_types.rb:43:3:43:58 | call to sig | (void) |
6367
| test_types.rb:49:3:49:65 | call to sig | String |
68+
| test_types.rb:52:3:52:55 | call to sig | Boolean |
6469
paramsCalls
6570
| test_types.rb:10:9:10:38 | call to params |
6671
| test_types.rb:13:9:13:26 | call to params |
@@ -71,6 +76,7 @@ paramsCalls
7176
| test_types.rb:43:9:43:51 | call to params |
7277
| test_types.rb:46:9:46:37 | call to params |
7378
| test_types.rb:49:9:49:47 | call to params |
79+
| test_types.rb:52:9:52:33 | call to params |
7480
returnsCall
7581
| test_types.rb:7:9:7:24 | call to returns | Integer |
7682
| test_types.rb:10:9:10:55 | call to returns | Integer |
@@ -80,6 +86,7 @@ returnsCall
8086
| test_types.rb:24:9:24:24 | call to returns | Integer |
8187
| test_types.rb:38:14:38:54 | call to returns | String |
8288
| test_types.rb:49:9:49:63 | call to returns | String |
89+
| test_types.rb:52:9:52:53 | call to returns | Boolean |
8390
voidCall
8491
| test_types.rb:4:9:4:12 | call to void |
8592
| test_types.rb:28:5:31:10 | call to void |
@@ -94,6 +101,7 @@ parameterTypes
94101
| test_types.rb:37:7:37:15 | Pair | test_types.rb:41:18:41:18 | a | test_types.rb:37:10:37:15 | String |
95102
| test_types.rb:38:7:38:54 | Pair | test_types.rb:41:21:41:26 | &block | test_types.rb:38:14:38:54 | call to returns |
96103
| test_types.rb:49:16:49:46 | Pair | test_types.rb:50:14:50:21 | new_name | test_types.rb:49:26:49:46 | call to any |
104+
| test_types.rb:52:16:52:32 | Pair | test_types.rb:53:24:53:28 | value | test_types.rb:52:23:52:32 | Boolean |
97105
procParameterTypes
98106
| test_types.rb:30:7:30:54 | Pair | test_types.rb:30:24:30:53 | call to void | test_types.rb:30:24:30:29 | call to proc | nilable |
99107
| test_types.rb:38:7:38:54 | Pair | test_types.rb:38:14:38:54 | call to returns | test_types.rb:38:14:38:19 | call to proc | non_nilable |
@@ -108,6 +116,7 @@ sigMethods
108116
| test_types.rb:43:3:43:58 | call to sig | test_types.rb:44:3:44:28 | read_hash |
109117
| test_types.rb:46:3:46:39 | call to sig | test_types.rb:47:3:47:34 | read_symbol_array |
110118
| test_types.rb:49:3:49:65 | call to sig | test_types.rb:50:3:50:27 | rename |
119+
| test_types.rb:52:3:52:55 | call to sig | test_types.rb:53:3:53:34 | debug_mode= |
111120
sigAttrReaders
112121
| test_types.rb:21:3:21:25 | call to sig | test_types.rb:22:3:22:26 | call to attr_reader |
113122
| test_types.rb:24:3:24:26 | call to sig | test_types.rb:25:3:25:24 | call to attr_accessor |

ruby/ql/test/library-tests/experimental/Rbi.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
private import codeql.ruby.AST
2-
private import codeql.ruby.DataFlow
32
private import codeql.ruby.controlflow.CfgNodes
43
private import codeql.ruby.experimental.Rbi::Rbi
54

ruby/ql/test/library-tests/experimental/test_types.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@ def read_symbol_array(*arr); end
4848

4949
sig { params(new_name: T.any(String, Symbol)).returns(String) }
5050
def rename(new_name); end
51+
52+
sig { params(value: T::Boolean).returns(T::Boolean) }
53+
def self.debug_mode=(value); end
5154
end

0 commit comments

Comments
 (0)