Skip to content

Commit 87944a3

Browse files
committed
Ruby: Add test for another case guard variant
1 parent 25ceeaf commit 87944a3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

ruby/ql/test/library-tests/dataflow/barrier-guards/barrier-guards.expected

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ oldStyleBarrierGuards
99
| barrier-guards.rb:43:4:43:15 | ... == ... | barrier-guards.rb:45:9:45:11 | foo | barrier-guards.rb:43:4:43:6 | foo | true |
1010
| barrier-guards.rb:70:4:70:21 | call to include? | barrier-guards.rb:71:5:71:7 | foo | barrier-guards.rb:70:18:70:20 | foo | true |
1111
| barrier-guards.rb:82:4:82:25 | ... != ... | barrier-guards.rb:83:5:83:7 | foo | barrier-guards.rb:82:15:82:17 | foo | true |
12+
| barrier-guards.rb:196:6:196:17 | ... == ... | barrier-guards.rb:197:5:197:7 | foo | barrier-guards.rb:196:6:196:8 | foo | true |
13+
| barrier-guards.rb:201:6:201:17 | ... == ... | barrier-guards.rb:201:24:201:26 | foo | barrier-guards.rb:201:6:201:8 | foo | true |
1214
newStyleBarrierGuards
1315
| barrier-guards.rb:4:5:4:7 | foo |
1416
| barrier-guards.rb:10:5:10:7 | foo |
@@ -27,6 +29,8 @@ newStyleBarrierGuards
2729
| barrier-guards.rb:154:5:154:7 | foo |
2830
| barrier-guards.rb:159:5:159:7 | foo |
2931
| barrier-guards.rb:164:5:164:7 | foo |
32+
| barrier-guards.rb:197:5:197:7 | foo |
33+
| barrier-guards.rb:201:24:201:26 | foo |
3034
controls
3135
| barrier-guards.rb:3:4:3:15 | ... == ... | barrier-guards.rb:4:5:4:7 | foo | true |
3236
| barrier-guards.rb:3:4:3:15 | ... == ... | barrier-guards.rb:6:5:6:7 | foo | false |
@@ -104,3 +108,5 @@ controls
104108
| barrier-guards.rb:191:4:191:15 | ... == ... | barrier-guards.rb:191:20:191:22 | foo | false |
105109
| barrier-guards.rb:191:4:191:31 | [true] ... or ... | barrier-guards.rb:192:5:192:7 | foo | true |
106110
| barrier-guards.rb:191:20:191:31 | ... == ... | barrier-guards.rb:191:4:191:31 | [false] ... or ... | false |
111+
| barrier-guards.rb:196:6:196:17 | ... == ... | barrier-guards.rb:197:5:197:7 | foo | true |
112+
| barrier-guards.rb:201:6:201:17 | ... == ... | barrier-guards.rb:201:24:201:26 | foo | true |

ruby/ql/test/library-tests/dataflow/barrier-guards/barrier-guards.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,12 @@
191191
if foo == "foo" or foo == "bar" # not recognised
192192
foo
193193
end
194+
195+
case
196+
when foo == "foo"
197+
foo
198+
end
199+
200+
case
201+
when foo == "foo" then foo
202+
end

0 commit comments

Comments
 (0)