mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Ruby: Add test for FrameworkModeEndpoints query
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
| lib/module.rb:2:3:3:5 | foo | mylib | M1 | foo | (x,y) | false | module.rb | |
|
||||
| lib/module.rb:5:3:6:5 | self_foo | mylib | M1! | self_foo | (x,y) | false | module.rb | |
|
||||
| lib/mylib.rb:4:3:5:5 | foo | mylib | A | foo | (x,y,key1:) | false | mylib.rb | |
|
||||
| lib/mylib.rb:7:3:8:5 | bar | mylib | A | bar | (x) | false | mylib.rb | |
|
||||
| lib/mylib.rb:10:3:11:5 | self_foo | mylib | A! | self_foo | (x,y) | false | mylib.rb | |
|
||||
| lib/mylib.rb:19:5:20:7 | foo | mylib | A::ANested | foo | (x,y) | false | mylib.rb | |
|
||||
| lib/other.rb:6:3:7:5 | foo | mylib | B | foo | (x,y) | false | other.rb | |
|
||||
| other_lib/lib/other_gem.rb:3:9:4:11 | foo | other-lib | OtherLib::A | foo | (x,y) | false | other_gem.rb | |
|
||||
@@ -0,0 +1 @@
|
||||
utils/modeleditor/FrameworkModeEndpoints.ql
|
||||
7
ruby/ql/test/query-tests/utils/modeleditor/lib/module.rb
Normal file
7
ruby/ql/test/query-tests/utils/modeleditor/lib/module.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
module M1
|
||||
def foo(x, y)
|
||||
end
|
||||
|
||||
def self.self_foo(x, y)
|
||||
end
|
||||
end
|
||||
27
ruby/ql/test/query-tests/utils/modeleditor/lib/mylib.rb
Normal file
27
ruby/ql/test/query-tests/utils/modeleditor/lib/mylib.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
require_relative "./other"
|
||||
|
||||
class A
|
||||
def foo(x, y, key1:, **kwargs, &block)
|
||||
end
|
||||
|
||||
def bar(x, *args)
|
||||
end
|
||||
|
||||
def self.self_foo(x, y)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def private_1(x, y)
|
||||
end
|
||||
|
||||
class ANested
|
||||
def foo(x, y)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def private_2(x, y)
|
||||
end
|
||||
end
|
||||
end
|
||||
12
ruby/ql/test/query-tests/utils/modeleditor/lib/other.rb
Normal file
12
ruby/ql/test/query-tests/utils/modeleditor/lib/other.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
require_relative "./module"
|
||||
|
||||
class B
|
||||
include M1
|
||||
|
||||
def foo(x, y)
|
||||
end
|
||||
end
|
||||
|
||||
class C
|
||||
extend M1
|
||||
end
|
||||
3
ruby/ql/test/query-tests/utils/modeleditor/mylib.gemspec
Normal file
3
ruby/ql/test/query-tests/utils/modeleditor/mylib.gemspec
Normal file
@@ -0,0 +1,3 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "mylib"
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
module OtherLib
|
||||
class A
|
||||
def foo(x, y)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
Gem::Specification.new("other-lib")
|
||||
Reference in New Issue
Block a user