aboutsummaryrefslogtreecommitdiffstats
path: root/test/indent/ruby.rb
diff options
context:
space:
mode:
authorPhillip Lord2015-11-23 22:02:42 +0000
committerPhillip Lord2015-11-24 17:04:22 +0000
commit22bbf7ca22f11cc33d887d0162cf2ec6661c3a3e (patch)
tree779ff7e07667194416e01c6a6e8bd7b970244c70 /test/indent/ruby.rb
parentc378d6c33f751d1a0b97958f3cacfe0b07c72f58 (diff)
downloademacs-22bbf7ca22f11cc33d887d0162cf2ec6661c3a3e.tar.gz
emacs-22bbf7ca22f11cc33d887d0162cf2ec6661c3a3e.zip
Rename all test files to reflect source layout.
* CONTRIBUTE,Makefile.in,configure.ac: Update to reflect test directory moves. * test/file-organisation.org: New file. * test/automated/Makefile.in test/automated/data/decompress/foo.gz test/automated/data/epg/pubkey.asc test/automated/data/epg/seckey.asc test/automated/data/files-bug18141.el.gz test/automated/data/flymake/test.c test/automated/data/flymake/test.pl test/automated/data/package/archive-contents test/automated/data/package/key.pub test/automated/data/package/key.sec test/automated/data/package/multi-file-0.2.3.tar test/automated/data/package/multi-file-readme.txt test/automated/data/package/newer-versions/archive-contents test/automated/data/package/newer-versions/new-pkg-1.0.el test/automated/data/package/newer-versions/simple-single-1.4.el test/automated/data/package/package-test-server.py test/automated/data/package/signed/archive-contents test/automated/data/package/signed/archive-contents.sig test/automated/data/package/signed/signed-bad-1.0.el test/automated/data/package/signed/signed-bad-1.0.el.sig test/automated/data/package/signed/signed-good-1.0.el test/automated/data/package/signed/signed-good-1.0.el.sig test/automated/data/package/simple-depend-1.0.el test/automated/data/package/simple-single-1.3.el test/automated/data/package/simple-single-readme.txt test/automated/data/package/simple-two-depend-1.1.el test/automated/abbrev-tests.el test/automated/auto-revert-tests.el test/automated/calc-tests.el test/automated/icalendar-tests.el test/automated/character-fold-tests.el test/automated/comint-testsuite.el test/automated/descr-text-test.el test/automated/electric-tests.el test/automated/cl-generic-tests.el test/automated/cl-lib-tests.el test/automated/eieio-test-methodinvoke.el test/automated/eieio-test-persist.el test/automated/eieio-tests.el test/automated/ert-tests.el test/automated/ert-x-tests.el test/automated/generator-tests.el test/automated/let-alist.el test/automated/map-tests.el test/automated/advice-tests.el test/automated/package-test.el test/automated/pcase-tests.el test/automated/regexp-tests.el test/automated/seq-tests.el test/automated/subr-x-tests.el test/automated/tabulated-list-test.el test/automated/thunk-tests.el test/automated/timer-tests.el test/automated/epg-tests.el test/automated/eshell.el test/automated/faces-tests.el test/automated/file-notify-tests.el test/automated/auth-source-tests.el test/automated/gnus-tests.el test/automated/message-mode-tests.el test/automated/help-fns.el test/automated/imenu-test.el test/automated/info-xref.el test/automated/mule-util.el test/automated/isearch-tests.el test/automated/json-tests.el test/automated/bytecomp-tests.el test/automated/coding-tests.el test/automated/core-elisp-tests.el test/automated/decoder-tests.el test/automated/files.el test/automated/font-parse-tests.el test/automated/lexbind-tests.el test/automated/occur-tests.el test/automated/process-tests.el test/automated/syntax-tests.el test/automated/textprop-tests.el test/automated/undo-tests.el test/automated/man-tests.el test/automated/completion-tests.el test/automated/dbus-tests.el test/automated/newsticker-tests.el test/automated/sasl-scram-rfc-tests.el test/automated/tramp-tests.el test/automated/obarray-tests.el test/automated/compile-tests.el test/automated/elisp-mode-tests.el test/automated/f90.el test/automated/flymake-tests.el test/automated/python-tests.el test/automated/ruby-mode-tests.el test/automated/subword-tests.el test/automated/replace-tests.el test/automated/simple-test.el test/automated/sort-tests.el test/automated/subr-tests.el test/automated/reftex-tests.el test/automated/sgml-mode-tests.el test/automated/tildify-tests.el test/automated/thingatpt.el test/automated/url-future-tests.el test/automated/url-util-tests.el test/automated/add-log-tests.el test/automated/vc-bzr.el test/automated/vc-tests.el test/automated/xml-parse-tests.el test/BidiCharacterTest.txt test/biditest.el test/cedet/cedet-utests.el test/cedet/ede-tests.el test/cedet/semantic-ia-utest.el test/cedet/semantic-tests.el test/cedet/semantic-utest-c.el test/cedet/semantic-utest.el test/cedet/srecode-tests.el test/cedet/tests/test.c test/cedet/tests/test.el test/cedet/tests/test.make test/cedet/tests/testdoublens.cpp test/cedet/tests/testdoublens.hpp test/cedet/tests/testfriends.cpp test/cedet/tests/testjavacomp.java test/cedet/tests/testnsp.cpp test/cedet/tests/testpolymorph.cpp test/cedet/tests/testspp.c test/cedet/tests/testsppcomplete.c test/cedet/tests/testsppreplace.c test/cedet/tests/testsppreplaced.c test/cedet/tests/testsubclass.cpp test/cedet/tests/testsubclass.hh test/cedet/tests/testtypedefs.cpp test/cedet/tests/testvarnames.c test/etags/CTAGS.good test/etags/ETAGS.good_1 test/etags/ETAGS.good_2 test/etags/ETAGS.good_3 test/etags/ETAGS.good_4 test/etags/ETAGS.good_5 test/etags/ETAGS.good_6 test/etags/a-src/empty.zz test/etags/a-src/empty.zz.gz test/etags/ada-src/2ataspri.adb test/etags/ada-src/2ataspri.ads test/etags/ada-src/etags-test-for.ada test/etags/ada-src/waroquiers.ada test/etags/c-src/a/b/b.c test/etags/c-src/abbrev.c test/etags/c-src/c.c test/etags/c-src/dostorture.c test/etags/c-src/emacs/src/gmalloc.c test/etags/c-src/emacs/src/keyboard.c test/etags/c-src/emacs/src/lisp.h test/etags/c-src/emacs/src/regex.h test/etags/c-src/etags.c test/etags/c-src/exit.c test/etags/c-src/exit.strange_suffix test/etags/c-src/fail.c test/etags/c-src/getopt.h test/etags/c-src/h.h test/etags/c-src/machsyscalls.c test/etags/c-src/machsyscalls.h test/etags/c-src/sysdep.h test/etags/c-src/tab.c test/etags/c-src/torture.c test/etags/cp-src/MDiagArray2.h test/etags/cp-src/Range.h test/etags/cp-src/burton.cpp test/etags/cp-src/c.C test/etags/cp-src/clheir.cpp.gz test/etags/cp-src/clheir.hpp test/etags/cp-src/conway.cpp test/etags/cp-src/conway.hpp test/etags/cp-src/fail.C test/etags/cp-src/functions.cpp test/etags/cp-src/screen.cpp test/etags/cp-src/screen.hpp test/etags/cp-src/x.cc test/etags/el-src/TAGTEST.EL test/etags/el-src/emacs/lisp/progmodes/etags.el test/etags/erl-src/gs_dialog.erl test/etags/f-src/entry.for test/etags/f-src/entry.strange.gz test/etags/f-src/entry.strange_suffix test/etags/forth-src/test-forth.fth test/etags/html-src/algrthms.html test/etags/html-src/index.shtml test/etags/html-src/software.html test/etags/html-src/softwarelibero.html test/etags/lua-src/allegro.lua test/etags/objc-src/PackInsp.h test/etags/objc-src/PackInsp.m test/etags/objc-src/Subprocess.h test/etags/objc-src/Subprocess.m test/etags/objcpp-src/SimpleCalc.H test/etags/objcpp-src/SimpleCalc.M test/etags/pas-src/common.pas test/etags/perl-src/htlmify-cystic test/etags/perl-src/kai-test.pl test/etags/perl-src/yagrip.pl test/etags/php-src/lce_functions.php test/etags/php-src/ptest.php test/etags/php-src/sendmail.php test/etags/prol-src/natded.prolog test/etags/prol-src/ordsets.prolog test/etags/ps-src/rfc1245.ps test/etags/pyt-src/server.py test/etags/tex-src/gzip.texi test/etags/tex-src/nonewline.tex test/etags/tex-src/testenv.tex test/etags/tex-src/texinfo.tex test/etags/y-src/atest.y test/etags/y-src/cccp.c test/etags/y-src/cccp.y test/etags/y-src/parse.c test/etags/y-src/parse.y test/indent/css-mode.css test/indent/js-indent-init-dynamic.js test/indent/js-indent-init-t.js test/indent/js-jsx.js test/indent/js.js test/indent/latex-mode.tex test/indent/modula2.mod test/indent/nxml.xml test/indent/octave.m test/indent/pascal.pas test/indent/perl.perl test/indent/prolog.prolog test/indent/ps-mode.ps test/indent/ruby.rb test/indent/scheme.scm test/indent/scss-mode.scss test/indent/sgml-mode-attribute.html test/indent/shell.rc test/indent/shell.sh test/redisplay-testsuite.el test/rmailmm.el test/automated/buffer-tests.el test/automated/cmds-tests.el test/automated/data-tests.el test/automated/finalizer-tests.el test/automated/fns-tests.el test/automated/inotify-test.el test/automated/keymap-tests.el test/automated/print-tests.el test/automated/libxml-tests.el test/automated/zlib-tests.el: Files Moved.
Diffstat (limited to 'test/indent/ruby.rb')
-rw-r--r--test/indent/ruby.rb414
1 files changed, 0 insertions, 414 deletions
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
deleted file mode 100644
index dec6de98605..00000000000
--- a/test/indent/ruby.rb
+++ /dev/null
@@ -1,414 +0,0 @@
1if something_wrong? # ruby-move-to-block-skips-heredoc
2 ActiveSupport::Deprecation.warn(<<-eowarn)
3 boo hoo
4 end
5 eowarn
6 foo
7end
8
9def foo
10 %^bar^
11end
12
13# Percent literals.
14b = %Q{This is a "string"}
15c = %w!foo
16 bar
17 baz!
18d = %(hello (nested) world)
19
20# Don't propertize percent literals inside strings.
21"(%s, %s)" % [123, 456]
22
23"abc/#{def}ghi"
24"abc\#{def}ghi"
25
26# Or inside comments.
27x = # "tot %q/to"; =
28 y = 2 / 3
29
30# Regexp after whitelisted method.
31"abc".sub /b/, 'd'
32
33# Don't mis-match "sub" at the end of words.
34a = asub / aslb + bsub / bslb;
35
36# Highlight the regexp after "if".
37x = toto / foo if /do bar/ =~ "dobar"
38
39# Regexp options are highlighted.
40
41/foo/xi != %r{bar}mo.tee
42
43foo { /"tee/
44 bar { |qux| /'fee"/ } # bug#20026
45}
46
47bar(class: XXX) do # ruby-indent-keyword-label
48 foo
49end
50bar
51
52foo = [1, # ruby-deep-indent
53 2]
54
55foo = { # ruby-deep-indent-disabled
56 a: b
57}
58
59foo = { a: b,
60 a1: b1
61 }
62
63foo({ # bug#16118
64 a: b,
65 c: d
66 })
67
68bar = foo(
69 a, [
70 1,
71 ],
72 :qux => [
73 3
74 ])
75
76foo(
77 [
78 {
79 a: b
80 },
81 ],
82 {
83 c: d
84 }
85)
86
87foo([{
88 a: 2
89 },
90 {
91 b: 3
92 },
93 4
94 ])
95
96foo = [ # ruby-deep-indent-disabled
97 1
98]
99
100foo( # ruby-deep-indent-disabled
101 a
102)
103
104# Multiline regexp.
105/bars
106 tees # toots
107 nfoos/
108
109def test1(arg)
110 puts "hello"
111end
112
113def test2 (arg)
114 a = "apple"
115
116 if a == 2
117 puts "hello"
118 else
119 puts "there"
120 end
121
122 if a == 2 then
123 puts "hello"
124 elsif a == 3
125 puts "hello3"
126 elsif a == 3 then
127 puts "hello3"
128 else
129 puts "there"
130 end
131
132 b = case a
133 when "a"
134 6
135 # Support for this syntax was removed in Ruby 1.9, so we
136 # probably don't need to handle it either.
137 # when "b" :
138 # 7
139 # when "c" : 2
140 when "d" then 4
141 else 5
142 end
143end
144
145# Some Cucumber code:
146Given /toto/ do
147 print "hello"
148end
149
150# Bug#15208
151if something == :==
152 do_something
153
154 return false unless method == :+
155 x = y + z # Bug#16609
156
157 a = 1 ? 2 :(
158 2 + 3
159 )
160end
161
162# Bug#17097
163if x == :!=
164 something
165end
166
167# Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
168d = 4 + 5 + # no '\' needed
169 6 + 7
170
171# Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html
172e = 8 + 9 \
173 + 10 # '\' needed
174
175foo = obj.bar { |m| tee(m) } +
176 obj.qux { |m| hum(m) }
177
178begin
179 foo
180ensure
181 bar
182end
183
184# Bug#15369
185MSG = 'Separate every 3 digits in the integer portion of a number' \
186 'with underscores(_).'
187
188class C
189 def foo
190 self.end
191 D.new.class
192 end
193end
194
195a = foo(j, k) -
196 bar_tee
197
198while a < b do # "do" is optional
199 foo
200end
201
202desc "foo foo" \
203 "bar bar"
204
205foo.
206 bar
207
208# https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206
209foo
210 .bar
211
212z = {
213 foo: {
214 a: "aaa",
215 b: "bbb"
216 }
217}
218
219foo if
220 bar
221
222if foo?
223 bar
224end
225
226method arg1, # bug#15594
227 method2 arg2,
228 arg3
229
230method? arg1,
231 arg2
232
233method! arg1,
234 arg2
235
236method !arg1,
237 arg2
238
239method [],
240 arg2
241
242method :foo,
243 :bar
244
245method (a + b),
246 c, :d => :e,
247 f: g
248
249desc "abc",
250 defg
251
252it "is a method call with block" do |asd|
253 foo
254end
255
256it("is too!") {
257 bar
258 .qux
259}
260
261and_this_one(has) { |block, parameters|
262 tee
263}
264
265if foo &&
266 bar
267end
268
269foo +
270 bar
271
272foo and
273 bar
274
275foo > bar &&
276 tee < qux
277
278zux do
279 foo == bar and
280 tee == qux
281end
282
283foo ^
284 bar
285
286foo_bar_tee(1, 2, 3)
287 .qux.bar
288 .tee
289
290foo do
291 bar
292 .tee
293end
294
295def bar
296 foo
297 .baz
298end
299
300# http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation
301tee = if foo
302 bar
303 else
304 tee
305 end
306
307a = b {
308 c
309}
310
311aa = bb do
312 cc
313end
314
315foo :bar do
316 qux
317end
318
319foo do |*args|
320 tee
321end
322
323bar do |&block|
324 tee
325end
326
327foo = [1, 2, 3].map do |i|
328 i + 1
329end
330
331bar.foo do
332 bar
333end
334
335bar.foo(tee) do
336 bar
337end
338
339bar.foo(tee) {
340 bar
341}
342
343bar 1 do
344 foo 2 do
345 tee
346 end
347end
348
349foo |
350 bar
351
352def qux
353 foo ||= begin
354 bar
355 tee
356 rescue
357 oomph
358 end
359end
360
361private def foo
362 bar
363end
364
365%^abc^
366ddd
367
368qux = foo.fee ?
369 bar :
370 tee
371
372zoo.keep.bar!(
373 {x: y,
374 z: t})
375
376zoo
377 .lose(
378 q, p)
379
380a.records().map(&:b).zip(
381 foo)
382
383# FIXME: This is not consistent with the example below it, but this
384# offset only happens if the colon is at eol, which wouldn't be often.
385# Tokenizing `bar:' as `:bar =>' would be better, but it's hard to
386# distinguish from a variable reference inside a ternary operator.
387foo(bar:
388 tee)
389
390foo(:bar =>
391 tee)
392
393{'a' => {
394 'b' => 'c',
395 'd' => %w(e f)
396 }
397}
398
399# Bug#17050
400
401return render json: {
402 errors: { base: [message] },
403 copying: copying
404 },
405 status: 400
406
407top test(
408 some,
409 top,
410 test)
411
412foo bar, {
413 tee: qux
414 }