aboutsummaryrefslogtreecommitdiffstats
path: root/test/indent/ruby.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/indent/ruby.rb')
-rw-r--r--test/indent/ruby.rb30
1 files changed, 19 insertions, 11 deletions
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
index c4a747a1c78..4f2e9e63377 100644
--- a/test/indent/ruby.rb
+++ b/test/indent/ruby.rb
@@ -1,17 +1,25 @@
1# Don't mis-match "sub" at the end of words. 1# Percent literals.
2a = asub / aslb + bsub / bslb;
3
4b = %Q{This is a "string"} 2b = %Q{This is a "string"}
5c = %w(foo 3c = %w!foo
6 bar 4 bar
7 baz) 5 baz!
8d = %!hello! 6d = %(hello (nested) world)
7
8# Don't propertize percent literals inside strings.
9"(%s, %s)" % [123, 456]
10
11# Or inside comments.
12x = # "tot %q/to"; =
13y = 2 / 3
14
15# Regexp after whitelisted method.
16"abc".sub /b/, 'd'
17
18# Don't mis-match "sub" at the end of words.
19a = asub / aslb + bsub / bslb;
9 20
10# A "do" after a slash means that slash is not a division, but it doesn't imply 21# Highlight the regexp after "if".
11# it's a regexp-ender, since it can be a regexp-starter instead! 22x = toto / foo if /do bar/ =~ "dobar"
12x = toto / foo; if /do bar/ then
13 toto = 1
14 end
15 23
16# Some Cucumber code: 24# Some Cucumber code:
17Given /toto/ do 25Given /toto/ do