Skip to content

Commit 7a22923

Browse files
committed
Ruby: Inline expectation should have space before $
1 parent 5c38e5d commit 7a22923

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

ruby/ql/test/query-tests/variables/DeadStoreOfLocal/DeadStoreOfLocal.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
def test_basic(x)
2-
y = x #$ Alert
2+
y = x # $ Alert
33
y = x + 2
44
return y
55
end
@@ -27,7 +27,7 @@ def m(x)
2727
print(x + 1)
2828
end
2929
end
30-
30+
3131
class Sub < Sup
3232
def m(y)
3333
y = 3 # OK - the call to `super` sees the value of `y``
@@ -39,7 +39,7 @@ def do_twice
3939
yield
4040
yield
4141
end
42-
42+
4343
def get_done_twice x
4444
do_twice do
4545
print x
@@ -52,7 +52,7 @@ def retry_once
5252
rescue
5353
yield
5454
end
55-
55+
5656
def get_retried x
5757
retry_once do
5858
print x
@@ -63,4 +63,4 @@ def get_retried x
6363
end
6464
end
6565
end
66-
end
66+
end

ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def foo
99
m # reads local variable m
1010
else
1111
end
12-
m.strip #$ Alert
12+
m.strip # $ Alert
1313
m2 # undefined local variable or method 'm2' for main (NameError)
1414
end
1515

@@ -31,7 +31,7 @@ def test_guards
3131
b&.strip # OK - safe navigation
3232
b.strip if b # OK
3333
b.close if b && !b.closed # OK
34-
b.blowup if b || !b.blownup #$ Alert
34+
b.blowup if b || !b.blownup # $ Alert
3535

3636
if false
3737
c = "0"
@@ -64,7 +64,7 @@ def test_loop
6464
a = 0
6565
else
6666
set_a
67-
end
67+
end
6868
end until a # OK
6969
a.strip # OK - given previous until
7070
end
@@ -73,5 +73,5 @@ def test_for
7373
for i in ["foo", "bar"] # OK - since 0..10 cannot raise
7474
puts i.strip
7575
end
76-
i.strip #$ SPURIOUS: Alert
77-
end
76+
i.strip # $ SPURIOUS: Alert
77+
end

0 commit comments

Comments
 (0)