diff options
Diffstat (limited to 'test/indent/ruby.rb')
| -rw-r--r-- | test/indent/ruby.rb | 30 |
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. |
| 2 | a = asub / aslb + bsub / bslb; | ||
| 3 | |||
| 4 | b = %Q{This is a "string"} | 2 | b = %Q{This is a "string"} |
| 5 | c = %w(foo | 3 | c = %w!foo |
| 6 | bar | 4 | bar |
| 7 | baz) | 5 | baz! |
| 8 | d = %!hello! | 6 | d = %(hello (nested) world) |
| 7 | |||
| 8 | # Don't propertize percent literals inside strings. | ||
| 9 | "(%s, %s)" % [123, 456] | ||
| 10 | |||
| 11 | # Or inside comments. | ||
| 12 | x = # "tot %q/to"; = | ||
| 13 | y = 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. | ||
| 19 | a = 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! | 22 | x = toto / foo if /do bar/ =~ "dobar" |
| 12 | x = toto / foo; if /do bar/ then | ||
| 13 | toto = 1 | ||
| 14 | end | ||
| 15 | 23 | ||
| 16 | # Some Cucumber code: | 24 | # Some Cucumber code: |
| 17 | Given /toto/ do | 25 | Given /toto/ do |