Skip to content

Commit 0912e3b

Browse files
committed
ruby: use inline expectation tests
1 parent 9211043 commit 0912e3b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
queries/performance/DatabaseQueryInLoop.ql
1+
query: queries/performance/DatabaseQueryInLoop.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql

ruby/ql/test/query-tests/performance/DatabaseQueryInLoop/DatabaseQueryInLoop.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ def test
88

99
# simple query in loop
1010
names.map do |name|
11-
User.where(login: name).pluck(:id).first
11+
User.where(login: name).pluck(:id).first # $ Alert
1212
end
1313

1414
# nested loop
1515
names.map do |name|
16-
user = User.where(login: name).pluck(:id).first
16+
user = User.where(login: name).pluck(:id).first # $ Alert
1717

1818
ids.map do |user_id|
19-
User.where(id: user_id).pluck(:id).first
19+
User.where(id: user_id).pluck(:id).first # $ Alert
2020
end
2121
end
2222

0 commit comments

Comments
 (0)