diff options
| author | Phillip Lord | 2015-11-23 22:02:42 +0000 |
|---|---|---|
| committer | Phillip Lord | 2015-11-24 17:04:22 +0000 |
| commit | 22bbf7ca22f11cc33d887d0162cf2ec6661c3a3e (patch) | |
| tree | 779ff7e07667194416e01c6a6e8bd7b970244c70 /test/indent/ruby.rb | |
| parent | c378d6c33f751d1a0b97958f3cacfe0b07c72f58 (diff) | |
| download | emacs-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.rb | 414 |
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 @@ | |||
| 1 | if something_wrong? # ruby-move-to-block-skips-heredoc | ||
| 2 | ActiveSupport::Deprecation.warn(<<-eowarn) | ||
| 3 | boo hoo | ||
| 4 | end | ||
| 5 | eowarn | ||
| 6 | foo | ||
| 7 | end | ||
| 8 | |||
| 9 | def foo | ||
| 10 | %^bar^ | ||
| 11 | end | ||
| 12 | |||
| 13 | # Percent literals. | ||
| 14 | b = %Q{This is a "string"} | ||
| 15 | c = %w!foo | ||
| 16 | bar | ||
| 17 | baz! | ||
| 18 | d = %(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. | ||
| 27 | x = # "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. | ||
| 34 | a = asub / aslb + bsub / bslb; | ||
| 35 | |||
| 36 | # Highlight the regexp after "if". | ||
| 37 | x = toto / foo if /do bar/ =~ "dobar" | ||
| 38 | |||
| 39 | # Regexp options are highlighted. | ||
| 40 | |||
| 41 | /foo/xi != %r{bar}mo.tee | ||
| 42 | |||
| 43 | foo { /"tee/ | ||
| 44 | bar { |qux| /'fee"/ } # bug#20026 | ||
| 45 | } | ||
| 46 | |||
| 47 | bar(class: XXX) do # ruby-indent-keyword-label | ||
| 48 | foo | ||
| 49 | end | ||
| 50 | bar | ||
| 51 | |||
| 52 | foo = [1, # ruby-deep-indent | ||
| 53 | 2] | ||
| 54 | |||
| 55 | foo = { # ruby-deep-indent-disabled | ||
| 56 | a: b | ||
| 57 | } | ||
| 58 | |||
| 59 | foo = { a: b, | ||
| 60 | a1: b1 | ||
| 61 | } | ||
| 62 | |||
| 63 | foo({ # bug#16118 | ||
| 64 | a: b, | ||
| 65 | c: d | ||
| 66 | }) | ||
| 67 | |||
| 68 | bar = foo( | ||
| 69 | a, [ | ||
| 70 | 1, | ||
| 71 | ], | ||
| 72 | :qux => [ | ||
| 73 | 3 | ||
| 74 | ]) | ||
| 75 | |||
| 76 | foo( | ||
| 77 | [ | ||
| 78 | { | ||
| 79 | a: b | ||
| 80 | }, | ||
| 81 | ], | ||
| 82 | { | ||
| 83 | c: d | ||
| 84 | } | ||
| 85 | ) | ||
| 86 | |||
| 87 | foo([{ | ||
| 88 | a: 2 | ||
| 89 | }, | ||
| 90 | { | ||
| 91 | b: 3 | ||
| 92 | }, | ||
| 93 | 4 | ||
| 94 | ]) | ||
| 95 | |||
| 96 | foo = [ # ruby-deep-indent-disabled | ||
| 97 | 1 | ||
| 98 | ] | ||
| 99 | |||
| 100 | foo( # ruby-deep-indent-disabled | ||
| 101 | a | ||
| 102 | ) | ||
| 103 | |||
| 104 | # Multiline regexp. | ||
| 105 | /bars | ||
| 106 | tees # toots | ||
| 107 | nfoos/ | ||
| 108 | |||
| 109 | def test1(arg) | ||
| 110 | puts "hello" | ||
| 111 | end | ||
| 112 | |||
| 113 | def 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 | ||
| 143 | end | ||
| 144 | |||
| 145 | # Some Cucumber code: | ||
| 146 | Given /toto/ do | ||
| 147 | print "hello" | ||
| 148 | end | ||
| 149 | |||
| 150 | # Bug#15208 | ||
| 151 | if 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 | ) | ||
| 160 | end | ||
| 161 | |||
| 162 | # Bug#17097 | ||
| 163 | if x == :!= | ||
| 164 | something | ||
| 165 | end | ||
| 166 | |||
| 167 | # Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html | ||
| 168 | d = 4 + 5 + # no '\' needed | ||
| 169 | 6 + 7 | ||
| 170 | |||
| 171 | # Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html | ||
| 172 | e = 8 + 9 \ | ||
| 173 | + 10 # '\' needed | ||
| 174 | |||
| 175 | foo = obj.bar { |m| tee(m) } + | ||
| 176 | obj.qux { |m| hum(m) } | ||
| 177 | |||
| 178 | begin | ||
| 179 | foo | ||
| 180 | ensure | ||
| 181 | bar | ||
| 182 | end | ||
| 183 | |||
| 184 | # Bug#15369 | ||
| 185 | MSG = 'Separate every 3 digits in the integer portion of a number' \ | ||
| 186 | 'with underscores(_).' | ||
| 187 | |||
| 188 | class C | ||
| 189 | def foo | ||
| 190 | self.end | ||
| 191 | D.new.class | ||
| 192 | end | ||
| 193 | end | ||
| 194 | |||
| 195 | a = foo(j, k) - | ||
| 196 | bar_tee | ||
| 197 | |||
| 198 | while a < b do # "do" is optional | ||
| 199 | foo | ||
| 200 | end | ||
| 201 | |||
| 202 | desc "foo foo" \ | ||
| 203 | "bar bar" | ||
| 204 | |||
| 205 | foo. | ||
| 206 | bar | ||
| 207 | |||
| 208 | # https://github.com/rails/rails/blob/17f5d8e062909f1fcae25351834d8e89967b645e/activesupport/lib/active_support/time_with_zone.rb#L206 | ||
| 209 | foo | ||
| 210 | .bar | ||
| 211 | |||
| 212 | z = { | ||
| 213 | foo: { | ||
| 214 | a: "aaa", | ||
| 215 | b: "bbb" | ||
| 216 | } | ||
| 217 | } | ||
| 218 | |||
| 219 | foo if | ||
| 220 | bar | ||
| 221 | |||
| 222 | if foo? | ||
| 223 | bar | ||
| 224 | end | ||
| 225 | |||
| 226 | method arg1, # bug#15594 | ||
| 227 | method2 arg2, | ||
| 228 | arg3 | ||
| 229 | |||
| 230 | method? arg1, | ||
| 231 | arg2 | ||
| 232 | |||
| 233 | method! arg1, | ||
| 234 | arg2 | ||
| 235 | |||
| 236 | method !arg1, | ||
| 237 | arg2 | ||
| 238 | |||
| 239 | method [], | ||
| 240 | arg2 | ||
| 241 | |||
| 242 | method :foo, | ||
| 243 | :bar | ||
| 244 | |||
| 245 | method (a + b), | ||
| 246 | c, :d => :e, | ||
| 247 | f: g | ||
| 248 | |||
| 249 | desc "abc", | ||
| 250 | defg | ||
| 251 | |||
| 252 | it "is a method call with block" do |asd| | ||
| 253 | foo | ||
| 254 | end | ||
| 255 | |||
| 256 | it("is too!") { | ||
| 257 | bar | ||
| 258 | .qux | ||
| 259 | } | ||
| 260 | |||
| 261 | and_this_one(has) { |block, parameters| | ||
| 262 | tee | ||
| 263 | } | ||
| 264 | |||
| 265 | if foo && | ||
| 266 | bar | ||
| 267 | end | ||
| 268 | |||
| 269 | foo + | ||
| 270 | bar | ||
| 271 | |||
| 272 | foo and | ||
| 273 | bar | ||
| 274 | |||
| 275 | foo > bar && | ||
| 276 | tee < qux | ||
| 277 | |||
| 278 | zux do | ||
| 279 | foo == bar and | ||
| 280 | tee == qux | ||
| 281 | end | ||
| 282 | |||
| 283 | foo ^ | ||
| 284 | bar | ||
| 285 | |||
| 286 | foo_bar_tee(1, 2, 3) | ||
| 287 | .qux.bar | ||
| 288 | .tee | ||
| 289 | |||
| 290 | foo do | ||
| 291 | bar | ||
| 292 | .tee | ||
| 293 | end | ||
| 294 | |||
| 295 | def bar | ||
| 296 | foo | ||
| 297 | .baz | ||
| 298 | end | ||
| 299 | |||
| 300 | # http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation | ||
| 301 | tee = if foo | ||
| 302 | bar | ||
| 303 | else | ||
| 304 | tee | ||
| 305 | end | ||
| 306 | |||
| 307 | a = b { | ||
| 308 | c | ||
| 309 | } | ||
| 310 | |||
| 311 | aa = bb do | ||
| 312 | cc | ||
| 313 | end | ||
| 314 | |||
| 315 | foo :bar do | ||
| 316 | qux | ||
| 317 | end | ||
| 318 | |||
| 319 | foo do |*args| | ||
| 320 | tee | ||
| 321 | end | ||
| 322 | |||
| 323 | bar do |&block| | ||
| 324 | tee | ||
| 325 | end | ||
| 326 | |||
| 327 | foo = [1, 2, 3].map do |i| | ||
| 328 | i + 1 | ||
| 329 | end | ||
| 330 | |||
| 331 | bar.foo do | ||
| 332 | bar | ||
| 333 | end | ||
| 334 | |||
| 335 | bar.foo(tee) do | ||
| 336 | bar | ||
| 337 | end | ||
| 338 | |||
| 339 | bar.foo(tee) { | ||
| 340 | bar | ||
| 341 | } | ||
| 342 | |||
| 343 | bar 1 do | ||
| 344 | foo 2 do | ||
| 345 | tee | ||
| 346 | end | ||
| 347 | end | ||
| 348 | |||
| 349 | foo | | ||
| 350 | bar | ||
| 351 | |||
| 352 | def qux | ||
| 353 | foo ||= begin | ||
| 354 | bar | ||
| 355 | tee | ||
| 356 | rescue | ||
| 357 | oomph | ||
| 358 | end | ||
| 359 | end | ||
| 360 | |||
| 361 | private def foo | ||
| 362 | bar | ||
| 363 | end | ||
| 364 | |||
| 365 | %^abc^ | ||
| 366 | ddd | ||
| 367 | |||
| 368 | qux = foo.fee ? | ||
| 369 | bar : | ||
| 370 | tee | ||
| 371 | |||
| 372 | zoo.keep.bar!( | ||
| 373 | {x: y, | ||
| 374 | z: t}) | ||
| 375 | |||
| 376 | zoo | ||
| 377 | .lose( | ||
| 378 | q, p) | ||
| 379 | |||
| 380 | a.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. | ||
| 387 | foo(bar: | ||
| 388 | tee) | ||
| 389 | |||
| 390 | foo(:bar => | ||
| 391 | tee) | ||
| 392 | |||
| 393 | {'a' => { | ||
| 394 | 'b' => 'c', | ||
| 395 | 'd' => %w(e f) | ||
| 396 | } | ||
| 397 | } | ||
| 398 | |||
| 399 | # Bug#17050 | ||
| 400 | |||
| 401 | return render json: { | ||
| 402 | errors: { base: [message] }, | ||
| 403 | copying: copying | ||
| 404 | }, | ||
| 405 | status: 400 | ||
| 406 | |||
| 407 | top test( | ||
| 408 | some, | ||
| 409 | top, | ||
| 410 | test) | ||
| 411 | |||
| 412 | foo bar, { | ||
| 413 | tee: qux | ||
| 414 | } | ||