Skip to content

Commit 6f32401

Browse files
committed
Add unless x != test to barrier guards
This tests that the following call to `foo bar` is guarded: unless bar != "bar" foo bar end
1 parent 800e183 commit 6f32401

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
| barrier-guards.rb:3:4:3:15 | ... == ... | barrier-guards.rb:4:13:4:15 | foo | barrier-guards.rb:3:4:3:6 | foo | true |
2-
| barrier-guards.rb:9:4:9:24 | call to include? | barrier-guards.rb:10:13:10:15 | foo | barrier-guards.rb:9:21:9:23 | foo | true |
3-
| barrier-guards.rb:15:4:15:15 | ... != ... | barrier-guards.rb:18:14:18:16 | foo | barrier-guards.rb:15:4:15:6 | foo | false |
1+
| barrier-guards.rb:3:4:3:15 | ... == ... | barrier-guards.rb:4:5:4:7 | foo | barrier-guards.rb:3:4:3:6 | foo | true |
2+
| barrier-guards.rb:9:4:9:24 | call to include? | barrier-guards.rb:10:5:10:7 | foo | barrier-guards.rb:9:21:9:23 | foo | true |
3+
| barrier-guards.rb:15:4:15:15 | ... != ... | barrier-guards.rb:18:5:18:7 | foo | barrier-guards.rb:15:4:15:6 | foo | false |
4+
| barrier-guards.rb:21:8:21:19 | ... == ... | barrier-guards.rb:24:5:24:7 | foo | barrier-guards.rb:21:8:21:10 | foo | true |
5+
| barrier-guards.rb:27:8:27:19 | ... != ... | barrier-guards.rb:28:5:28:7 | foo | barrier-guards.rb:27:8:27:10 | foo | false |
Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
foo = "foo"
22

33
if foo == "foo"
4-
do_true foo
4+
foo
55
else
6-
do_false foo
6+
foo
77
end
88

99
if ["foo"].include?(foo)
10-
do_true foo
10+
foo
1111
else
12-
do_false foo
12+
foo
1313
end
1414

1515
if foo != "foo"
16-
do_true foo
16+
foo
1717
else
18-
do_false foo
18+
foo
1919
end
2020

21-
do_default foo
21+
unless foo == "foo"
22+
foo
23+
else
24+
foo
25+
end
26+
27+
unless foo != "foo"
28+
foo
29+
end
2230

31+
foo

0 commit comments

Comments
 (0)