aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/indent/ruby.rb21
1 files changed, 18 insertions, 3 deletions
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
index e40ef217e54..7c8de323bdb 100644
--- a/test/indent/ruby.rb
+++ b/test/indent/ruby.rb
@@ -99,6 +99,14 @@ if something == :==
99 do_something 99 do_something
100end 100end
101 101
102# Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
103d = 4 + 5 + # no '\' needed
104 6 + 7
105
106# Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
107e = 8 + 9 \
108 + 10 # '\' needed
109
102begin 110begin
103 foo 111 foo
104ensure 112ensure
@@ -109,20 +117,27 @@ end
109MSG = 'Separate every 3 digits in the integer portion of a number' + 117MSG = 'Separate every 3 digits in the integer portion of a number' +
110 'with underscores(_).' 118 'with underscores(_).'
111 119
112# Examples below fail with SMIE. 120class C
121 def foo
122 self.end
123 D.new.class
124 end
125end
113 126
114a = foo(j, k) - 127a = foo(j, k) -
115 bar_tee 128 bar_tee
116 129
117while a < b do # "do" is optional 130while a < b do # "do" is optional
118 foo 131 foo
119end 132end
120 133
121desc "foo foo" \ 134desc "foo foo" \
122 "bar bar" 135 "bar bar"
123 136
124foo. 137foo.
125 bar 138 bar
126 139
140# FIXME: is this really valid Ruby? Isn't the newline after "foo" treated as
141# an implicit semi-colon?
127foo 142foo
128 .bar 143 .bar