diff options
| author | Stefan Kangas | 2023-01-19 06:30:25 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2023-01-19 06:30:25 +0100 |
| commit | 9161a302c9f9fbfa1a8f33181bb332d2c5df3aa7 (patch) | |
| tree | 21de62aa23f4ad770ff8afe322c0223ea7e0af76 /test | |
| parent | efb9ec11bbee3871d77dc4e9217bd9293d525d5d (diff) | |
| parent | db727873803a974ba210c4942ae7cbcc3d6268ab (diff) | |
| download | emacs-9161a302c9f9fbfa1a8f33181bb332d2c5df3aa7.tar.gz emacs-9161a302c9f9fbfa1a8f33181bb332d2c5df3aa7.zip | |
Merge from origin/emacs-29
db727873803 ruby-ts-mode: Use font-lock-constant-face for true/false/nil
819719330ad (ruby-ts--indent-rules): Add a rule for continuation of a...
94b9cbf96fb (ruby-ts--parent-call-or-bol): Handle more cases with nes...
ba33b83ce4b (ruby-ts--statement-container-regexp): Remove "parenthesi...
f2bedf695c1 ruby-ts-mode: Handle indent in parenless calls much close...
758ac5eabbe Fix split-window-below for the case when split-window-kee...
8e9783b4ce4 Rebind in read-regexp-map ‘M-c’ to ‘M-s c’ compatible wit...
78f93d92b28 * lisp/vc/vc-dir.el: Make keys ‘% m’ and ‘* %’ compatible...
dc3f85fd4b0 Use proper types for Eshell warnings
6a8338a8bc8 ; Avoid byte-compiler warning in cc-fonts.el.
9186be20aeb ; Clarify doc strings of some functions in files.el
bd5ef3ef95e Improve the documentation of 'auto-mode-alist' search
1798ff5a663 ; Fix minor mistakes in documentation
faee7e1f1bd ; * lisp/treesit.el (treesit-font-lock-fontify-region): M...
24f0dfd3731 Revert "Revert "Add c-or-c++-ts-mode (bug#59613)""
ac3bc775b6f Make it harder to misactivate tree-sitter font-lock fast ...
bdd82fa7977 ; * src/treesit.c: Remove unused boilerplate.
343b9b3dfe3 ruby-ts-mode: Obey the option ruby-method-call-indent
045404d1aac ruby-ts-mode: Obey the option ruby-after-operator-indent
300ca6ac372 ruby-ts-mode: Fix indent after operator or conditional
ac5516bd7d5 ruby-ts-mode: Fix/change indentation of a continuation me...
5e2e68a0c2d ruby-ts-mode: Fix indent inside parenthesized_expr and el...
9ed9ff4690a ruby-ts-mode: Fix the rules for hanging arrays and hashes
c4f0b6ccea1 Add more detail about how to invoke Eshell commands
dbac923b9df CC Mode: On removal of "typedef", remove pertinent types ...
56d69c2fc47 ; Relax timeouts for failing ERC test
183e7492702 Don't preserve non-module minor modes in erc-open
7b8322f6285 Use correct buffer for local-module vars in erc-open
7b13422298a ; Avoid plist-get as generalized var in erc-compat
09e9d7c7496 Fix display of warnings on w32 console
bd094207c76 Fix buffer-list-update-hook for indirect buffers
9e7a5d58eea ; Fix tree-sitter indent anchor preset
7c61a304104 Fix treesit-node-first-child-for-pos (bug#60127)
b36cc7e7bbb ; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor ch...
# Conflicts:
# etc/NEWS
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/erc/erc-scenarios-base-local-modules.el | 100 | ||||
| -rw-r--r-- | test/lisp/erc/erc-tests.el | 41 | ||||
| -rw-r--r-- | test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld | 10 | ||||
| -rw-r--r-- | test/lisp/erc/resources/base/netid/bouncer/foonet-again.eld | 10 | ||||
| -rw-r--r-- | test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb | 94 | ||||
| -rw-r--r-- | test/lisp/progmodes/ruby-ts-mode-tests.el | 6 | ||||
| -rw-r--r-- | test/src/buffer-tests.el | 46 |
7 files changed, 254 insertions, 53 deletions
diff --git a/test/lisp/erc/erc-scenarios-base-local-modules.el b/test/lisp/erc/erc-scenarios-base-local-modules.el index d4001df45de..916d105779a 100644 --- a/test/lisp/erc/erc-scenarios-base-local-modules.el +++ b/test/lisp/erc/erc-scenarios-base-local-modules.el | |||
| @@ -19,8 +19,17 @@ | |||
| 19 | 19 | ||
| 20 | ;;; Commentary: | 20 | ;;; Commentary: |
| 21 | 21 | ||
| 22 | ;; These tests all use `sasl' because, as of ERC 5.5, it's the one | 22 | ;; A local module doubles as a minor mode whose mode variable and |
| 23 | ;; and only local module. | 23 | ;; associated local data can withstand service disruptions. |
| 24 | ;; Unfortunately, the current implementation is too unwieldy to be | ||
| 25 | ;; made public because it doesn't perform any of the boiler plate | ||
| 26 | ;; needed to save and restore buffer-local and "network-local" copies | ||
| 27 | ;; of user options. Ultimately, a user-friendly framework must fill | ||
| 28 | ;; this void if third-party local modules are ever to become | ||
| 29 | ;; practical. | ||
| 30 | ;; | ||
| 31 | ;; The following tests all use `sasl' because, as of ERC 5.5, it's the | ||
| 32 | ;; only local module. | ||
| 24 | 33 | ||
| 25 | ;;; Code: | 34 | ;;; Code: |
| 26 | 35 | ||
| @@ -206,7 +215,7 @@ | |||
| 206 | (erc-cmd-QUIT "") | 215 | (erc-cmd-QUIT "") |
| 207 | (funcall expect 10 "finished"))) | 216 | (funcall expect 10 "finished"))) |
| 208 | 217 | ||
| 209 | (ert-info ("Disabling works from a target buffer.") | 218 | (ert-info ("Disabling works from a target buffer") |
| 210 | (with-current-buffer "#chan" | 219 | (with-current-buffer "#chan" |
| 211 | (should erc-sasl-mode) | 220 | (should erc-sasl-mode) |
| 212 | (call-interactively #'erc-sasl-disable) | 221 | (call-interactively #'erc-sasl-disable) |
| @@ -214,10 +223,9 @@ | |||
| 214 | (should (local-variable-p 'erc-sasl-mode)) | 223 | (should (local-variable-p 'erc-sasl-mode)) |
| 215 | (should-not (buffer-local-value 'erc-sasl-mode (get-buffer "foonet"))) | 224 | (should-not (buffer-local-value 'erc-sasl-mode (get-buffer "foonet"))) |
| 216 | (erc-cmd-RECONNECT) | 225 | (erc-cmd-RECONNECT) |
| 217 | (with-current-buffer "#chan" | 226 | (funcall expect 10 "Some enigma, some riddle") |
| 218 | (funcall expect 10 "Some enigma, some riddle") | 227 | (should-not erc-sasl-mode) ; regression |
| 219 | (should-not erc-sasl-mode) ; regression | 228 | (should (local-variable-p 'erc-sasl-mode))) |
| 220 | (should (local-variable-p 'erc-sasl-mode)))) | ||
| 221 | 229 | ||
| 222 | (with-current-buffer "foonet" | 230 | (with-current-buffer "foonet" |
| 223 | (should (local-variable-p 'erc-sasl-mode)) | 231 | (should (local-variable-p 'erc-sasl-mode)) |
| @@ -239,4 +247,82 @@ | |||
| 239 | (should erc-sasl-mode) | 247 | (should erc-sasl-mode) |
| 240 | (funcall expect 10 "User modes for tester"))))) | 248 | (funcall expect 10 "User modes for tester"))))) |
| 241 | 249 | ||
| 250 | (defvar-local erc-scenarios-base-local-modules--local-var nil) | ||
| 251 | |||
| 252 | (define-erc-module -phony-sblm- nil | ||
| 253 | "Test module for `erc-scenarios-base-local-modules--var-persistence'." | ||
| 254 | ((when-let ((vars (or erc--server-reconnecting erc--target-priors))) | ||
| 255 | (should (assq 'erc--phony-sblm--mode vars)) | ||
| 256 | (setq erc-scenarios-base-local-modules--local-var | ||
| 257 | (alist-get 'erc-scenarios-base-local-modules--local-var vars))) | ||
| 258 | (setq erc-scenarios-base-local-modules--local-var | ||
| 259 | (or erc-scenarios-base-local-modules--local-var | ||
| 260 | (if erc--target 100 0)))) | ||
| 261 | ((kill-local-variable 'erc-scenarios-base-local-modules--local-var)) | ||
| 262 | 'local) | ||
| 263 | |||
| 264 | ;; Note: this file has grown too expensive (time-wise) and must be | ||
| 265 | ;; split up. When that happens, this test should be rewritten without | ||
| 266 | ;; any time-saving hacks, namely, server-initiated JOINs and an | ||
| 267 | ;; absence of QUITs. (That said, three connections in under 2 seconds | ||
| 268 | ;; is pretty nice.) | ||
| 269 | |||
| 270 | (ert-deftest erc-scenarios-base-local-modules--var-persistence () | ||
| 271 | :tags '(:expensive-test) | ||
| 272 | (erc-scenarios-common-with-cleanup | ||
| 273 | ((erc-scenarios-common-dialog "base/reconnect") | ||
| 274 | (erc-server-flood-penalty 0.1) | ||
| 275 | (dumb-server (erc-d-run "localhost" t 'options 'options 'options)) | ||
| 276 | (port (process-contact dumb-server :service)) | ||
| 277 | (erc-modules (cons '-phony-sblm- (remq 'autojoin erc-modules))) | ||
| 278 | (expect (erc-d-t-make-expecter)) | ||
| 279 | (server-buffer-name (format "127.0.0.1:%d" port))) | ||
| 280 | |||
| 281 | (ert-info ("Initial authentication succeeds as expected") | ||
| 282 | (with-current-buffer (erc :server "127.0.0.1" | ||
| 283 | :port port | ||
| 284 | :nick "tester" | ||
| 285 | :password "changeme" | ||
| 286 | :full-name "tester") | ||
| 287 | (should (string= (buffer-name) server-buffer-name))) | ||
| 288 | |||
| 289 | (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "FooNet")) | ||
| 290 | (funcall expect 10 "This server is in debug mode") | ||
| 291 | (should erc--phony-sblm--mode) | ||
| 292 | (should (eql erc-scenarios-base-local-modules--local-var 0)) | ||
| 293 | (setq erc-scenarios-base-local-modules--local-var 1))) | ||
| 294 | |||
| 295 | (ert-info ("Save module's local var in target buffer") | ||
| 296 | (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#chan")) | ||
| 297 | (should (eql erc-scenarios-base-local-modules--local-var 100)) | ||
| 298 | (setq erc-scenarios-base-local-modules--local-var 101) | ||
| 299 | (funcall expect 20 "welcome"))) | ||
| 300 | |||
| 301 | (with-current-buffer "FooNet" (funcall expect 20 "terminated")) | ||
| 302 | |||
| 303 | (ert-info ("Vars reused when mode was left enabled") | ||
| 304 | (with-current-buffer "#chan" | ||
| 305 | (erc-cmd-RECONNECT) | ||
| 306 | (funcall expect 20 "welcome") | ||
| 307 | (should (eql erc-scenarios-base-local-modules--local-var 101)) | ||
| 308 | (erc--phony-sblm--mode -1)) | ||
| 309 | |||
| 310 | (with-current-buffer "FooNet" | ||
| 311 | (funcall expect 10 "User modes for tester") | ||
| 312 | (should (eql erc-scenarios-base-local-modules--local-var 1)))) | ||
| 313 | |||
| 314 | (with-current-buffer "FooNet" (funcall expect 20 "terminated")) | ||
| 315 | |||
| 316 | (ert-info ("Local binding gone when mode disabled in target") | ||
| 317 | (with-current-buffer "#chan" | ||
| 318 | (erc-cmd-RECONNECT) | ||
| 319 | (funcall expect 20 "welcome") | ||
| 320 | (should-not erc--phony-sblm--mode) | ||
| 321 | (should-not erc-scenarios-base-local-modules--local-var)) | ||
| 322 | |||
| 323 | ;; But value retained in server buffer, where mode is active. | ||
| 324 | (with-current-buffer "FooNet" | ||
| 325 | (funcall expect 10 "User modes for tester") | ||
| 326 | (should (eql erc-scenarios-base-local-modules--local-var 1)))))) | ||
| 327 | |||
| 242 | ;;; erc-scenarios-local-modules.el ends here | 328 | ;;; erc-scenarios-local-modules.el ends here |
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 85506c3d27e..40a2d2de657 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el | |||
| @@ -1251,18 +1251,28 @@ | |||
| 1251 | (setq calls nil))))) | 1251 | (setq calls nil))))) |
| 1252 | 1252 | ||
| 1253 | (ert-deftest erc--merge-local-modes () | 1253 | (ert-deftest erc--merge-local-modes () |
| 1254 | 1254 | (cl-letf (((get 'erc-b-mode 'erc-module) 'b) | |
| 1255 | (ert-info ("No existing modes") | 1255 | ((get 'erc-c-mode 'erc-module) 'c) |
| 1256 | (let ((old '((a) (b . t))) | 1256 | ((get 'erc-d-mode 'erc-module) 'd) |
| 1257 | (new '(erc-c-mode erc-d-mode))) | 1257 | ((get 'erc-e-mode 'erc-module) 'e)) |
| 1258 | (should (equal (erc--merge-local-modes new old) | 1258 | |
| 1259 | '((erc-c-mode erc-d-mode)))))) | 1259 | (ert-info ("No existing modes") |
| 1260 | 1260 | (let ((old '((a) (b . t))) | |
| 1261 | (ert-info ("Active existing added, inactive existing removed, deduped") | 1261 | (new '(erc-c-mode erc-d-mode))) |
| 1262 | (let ((old '((a) (erc-b-mode) (c . t) (erc-d-mode . t) (erc-e-mode . t))) | 1262 | (should (equal (erc--merge-local-modes new old) |
| 1263 | (new '(erc-b-mode erc-d-mode))) | 1263 | '((erc-c-mode erc-d-mode)))))) |
| 1264 | (should (equal (erc--merge-local-modes new old) | 1264 | |
| 1265 | '((erc-d-mode erc-e-mode) . (erc-b-mode))))))) | 1265 | (ert-info ("Active existing added, inactive existing removed, deduped") |
| 1266 | (let ((old '((a) (erc-b-mode) (c . t) (erc-d-mode . t) (erc-e-mode . t))) | ||
| 1267 | (new '(erc-b-mode erc-d-mode))) | ||
| 1268 | (should (equal (erc--merge-local-modes new old) | ||
| 1269 | '((erc-d-mode erc-e-mode) . (erc-b-mode)))))) | ||
| 1270 | |||
| 1271 | (ert-info ("Non-module erc-prefixed mode ignored") | ||
| 1272 | (let ((old '((erc-b-mode) (erc-f-mode . t) (erc-d-mode . t))) | ||
| 1273 | (new '(erc-b-mode))) | ||
| 1274 | (should (equal (erc--merge-local-modes new old) | ||
| 1275 | '((erc-d-mode) . (erc-b-mode)))))))) | ||
| 1266 | 1276 | ||
| 1267 | (ert-deftest define-erc-module--global () | 1277 | (ert-deftest define-erc-module--global () |
| 1268 | (let ((global-module '(define-erc-module mname malias | 1278 | (let ((global-module '(define-erc-module mname malias |
| @@ -1300,13 +1310,15 @@ Some docstring" | |||
| 1300 | (ignore c) (ignore d)) | 1310 | (ignore c) (ignore d)) |
| 1301 | 1311 | ||
| 1302 | (defalias 'erc-malias-mode #'erc-mname-mode) | 1312 | (defalias 'erc-malias-mode #'erc-mname-mode) |
| 1313 | (put 'erc-malias-mode 'erc-module 'mname) | ||
| 1303 | 1314 | ||
| 1315 | (put 'erc-mname-mode 'erc-module 'mname) | ||
| 1304 | (put 'erc-mname-mode 'definition-name 'mname) | 1316 | (put 'erc-mname-mode 'definition-name 'mname) |
| 1305 | (put 'erc-mname-enable 'definition-name 'mname) | 1317 | (put 'erc-mname-enable 'definition-name 'mname) |
| 1306 | (put 'erc-mname-disable 'definition-name 'mname)))))) | 1318 | (put 'erc-mname-disable 'definition-name 'mname)))))) |
| 1307 | 1319 | ||
| 1308 | (ert-deftest define-erc-module--local () | 1320 | (ert-deftest define-erc-module--local () |
| 1309 | (let* ((global-module '(define-erc-module mname malias | 1321 | (let* ((global-module '(define-erc-module mname nil ; no alias |
| 1310 | "Some docstring" | 1322 | "Some docstring" |
| 1311 | ((ignore a) (ignore b)) | 1323 | ((ignore a) (ignore b)) |
| 1312 | ((ignore c) (ignore d)) | 1324 | ((ignore c) (ignore d)) |
| @@ -1353,8 +1365,7 @@ When called interactively, do so in all buffers for the current connection." | |||
| 1353 | (setq erc-mname-mode nil) | 1365 | (setq erc-mname-mode nil) |
| 1354 | (ignore c) (ignore d)))) | 1366 | (ignore c) (ignore d)))) |
| 1355 | 1367 | ||
| 1356 | (defalias 'erc-malias-mode #'erc-mname-mode) | 1368 | (put 'erc-mname-mode 'erc-module 'mname) |
| 1357 | |||
| 1358 | (put 'erc-mname-mode 'definition-name 'mname) | 1369 | (put 'erc-mname-mode 'definition-name 'mname) |
| 1359 | (put 'erc-mname-enable 'definition-name 'mname) | 1370 | (put 'erc-mname-enable 'definition-name 'mname) |
| 1360 | (put 'erc-mname-disable 'definition-name 'mname)))))) | 1371 | (put 'erc-mname-disable 'definition-name 'mname)))))) |
diff --git a/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld b/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld index e2fe1430283..a270c743d90 100644 --- a/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld +++ b/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;; -*- mode: lisp-data; -*- | 1 | ;; -*- mode: lisp-data; -*- |
| 2 | ((pass 10 "PASS :barnet:changeme")) | 2 | ((pass 10 "PASS :barnet:changeme")) |
| 3 | ((nick 3 "NICK tester")) | 3 | ((nick 10 "NICK tester")) |
| 4 | ((user 3 "USER user 0 * :tester") | 4 | ((user 10 "USER user 0 * :tester") |
| 5 | (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") | 5 | (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") |
| 6 | (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") | 6 | (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") |
| 7 | (0 ":irc.barnet.org 003 tester :This server was created Wed, 12 May 2021 07:41:08 UTC") | 7 | (0 ":irc.barnet.org 003 tester :This server was created Wed, 12 May 2021 07:41:08 UTC") |
| @@ -17,7 +17,7 @@ | |||
| 17 | (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") | 17 | (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") |
| 18 | (0 ":irc.barnet.org 422 tester :MOTD File is missing")) | 18 | (0 ":irc.barnet.org 422 tester :MOTD File is missing")) |
| 19 | 19 | ||
| 20 | ((mode-user 10.2 "MODE tester +i") | 20 | ((mode-user 10 "MODE tester +i") |
| 21 | ;; No mode answer ^ | 21 | ;; No mode answer ^ |
| 22 | 22 | ||
| 23 | (0 ":tester!~u@xrir8fpe4d7ak.irc JOIN #chan") | 23 | (0 ":tester!~u@xrir8fpe4d7ak.irc JOIN #chan") |
| @@ -36,9 +36,9 @@ | |||
| 36 | (0 ":irc.znc.in 306 tester :You have been marked as being away") | 36 | (0 ":irc.znc.in 306 tester :You have been marked as being away") |
| 37 | (0 ":irc.barnet.org 305 tester :You are no longer marked as being away")) | 37 | (0 ":irc.barnet.org 305 tester :You are no longer marked as being away")) |
| 38 | 38 | ||
| 39 | ((~join 3 "JOIN #chan")) | 39 | ((~join 10 "JOIN #chan")) |
| 40 | 40 | ||
| 41 | ((mode 5 "MODE #chan") | 41 | ((mode 10 "MODE #chan") |
| 42 | (0 ":irc.barnet.org 324 tester #chan +nt") | 42 | (0 ":irc.barnet.org 324 tester #chan +nt") |
| 43 | (0 ":irc.barnet.org 329 tester #chan 1620805269") | 43 | (0 ":irc.barnet.org 329 tester #chan 1620805269") |
| 44 | (0.1 ":joe!~u@svpn88yjcdj42.irc PRIVMSG #chan :mike: But, in defense, by mercy, 'tis most just.") | 44 | (0.1 ":joe!~u@svpn88yjcdj42.irc PRIVMSG #chan :mike: But, in defense, by mercy, 'tis most just.") |
diff --git a/test/lisp/erc/resources/base/netid/bouncer/foonet-again.eld b/test/lisp/erc/resources/base/netid/bouncer/foonet-again.eld index bf8712305a4..a8c352daaa7 100644 --- a/test/lisp/erc/resources/base/netid/bouncer/foonet-again.eld +++ b/test/lisp/erc/resources/base/netid/bouncer/foonet-again.eld | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;; -*- mode: lisp-data; -*- | 1 | ;; -*- mode: lisp-data; -*- |
| 2 | ((pass 10 "PASS :foonet:changeme")) | 2 | ((pass 10 "PASS :foonet:changeme")) |
| 3 | ((nick 3 "NICK tester")) | 3 | ((nick 10 "NICK tester")) |
| 4 | ((user 3 "USER user 0 * :tester") | 4 | ((user 10 "USER user 0 * :tester") |
| 5 | (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") | 5 | (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") |
| 6 | (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") | 6 | (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") |
| 7 | (0 ":irc.foonet.org 003 tester :This server was created Wed, 12 May 2021 07:41:09 UTC") | 7 | (0 ":irc.foonet.org 003 tester :This server was created Wed, 12 May 2021 07:41:09 UTC") |
| @@ -17,7 +17,7 @@ | |||
| 17 | (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") | 17 | (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") |
| 18 | (0 ":irc.foonet.org 422 tester :MOTD File is missing")) | 18 | (0 ":irc.foonet.org 422 tester :MOTD File is missing")) |
| 19 | 19 | ||
| 20 | ((mode-user 10.2 "MODE tester +i") | 20 | ((mode-user 10 "MODE tester +i") |
| 21 | ;; No mode answer ^ | 21 | ;; No mode answer ^ |
| 22 | (0 ":tester!~u@nvfhxvqm92rm6.irc JOIN #chan") | 22 | (0 ":tester!~u@nvfhxvqm92rm6.irc JOIN #chan") |
| 23 | (0 ":irc.foonet.org 353 tester = #chan :alice @bob tester") | 23 | (0 ":irc.foonet.org 353 tester = #chan :alice @bob tester") |
| @@ -36,9 +36,9 @@ | |||
| 36 | (0 ":irc.foonet.org NOTICE tester :[07:00:32] This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.") | 36 | (0 ":irc.foonet.org NOTICE tester :[07:00:32] This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.") |
| 37 | (0 ":irc.foonet.org 305 tester :You are no longer marked as being away")) | 37 | (0 ":irc.foonet.org 305 tester :You are no longer marked as being away")) |
| 38 | 38 | ||
| 39 | ((~join 3 "JOIN #chan")) | 39 | ((~join 10 "JOIN #chan")) |
| 40 | 40 | ||
| 41 | ((mode 8 "MODE #chan") | 41 | ((mode 10 "MODE #chan") |
| 42 | (0 ":irc.foonet.org 324 tester #chan +nt") | 42 | (0 ":irc.foonet.org 324 tester #chan +nt") |
| 43 | (0 ":irc.foonet.org 329 tester #chan 1620805271") | 43 | (0 ":irc.foonet.org 329 tester #chan 1620805271") |
| 44 | (0.1 ":alice!~u@svpn88yjcdj42.irc PRIVMSG #chan :bob: Grows, lives, and dies, in single blessedness.") | 44 | (0.1 ":alice!~u@svpn88yjcdj42.irc PRIVMSG #chan :bob: Grows, lives, and dies, in single blessedness.") |
diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb b/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb new file mode 100644 index 00000000000..4be532a5e9d --- /dev/null +++ b/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb | |||
| @@ -0,0 +1,94 @@ | |||
| 1 | variable = foo( | ||
| 2 | [ | ||
| 3 | qwe | ||
| 4 | ], [ | ||
| 5 | rty | ||
| 6 | ], { | ||
| 7 | a: 3 | ||
| 8 | } | ||
| 9 | ) | ||
| 10 | |||
| 11 | tee = [ | ||
| 12 | qwe | ||
| 13 | ] | ||
| 14 | |||
| 15 | qux = [1, | ||
| 16 | 2] | ||
| 17 | |||
| 18 | att = {a: 1, | ||
| 19 | b: 2} | ||
| 20 | |||
| 21 | a = 1 ? 2 :( | ||
| 22 | 2 + 3 | ||
| 23 | ) | ||
| 24 | |||
| 25 | unless bismark | ||
| 26 | sink += 12 | ||
| 27 | else | ||
| 28 | dog = 99 | ||
| 29 | end | ||
| 30 | |||
| 31 | foo1 = | ||
| 32 | subject.update( | ||
| 33 | 1 | ||
| 34 | ) | ||
| 35 | |||
| 36 | foo2 = | ||
| 37 | subject. | ||
| 38 | update( | ||
| 39 | # Might make sense to indent this to 'subject' instead; but this | ||
| 40 | # style seems more popular. | ||
| 41 | 2 | ||
| 42 | ) | ||
| 43 | |||
| 44 | foo > bar && | ||
| 45 | tee < qux | ||
| 46 | |||
| 47 | 1 .. 2 && | ||
| 48 | 3 | ||
| 49 | |||
| 50 | a = foo(j, k) - | ||
| 51 | bar_tee | ||
| 52 | |||
| 53 | qux = foo.fee ? | ||
| 54 | bar : | ||
| 55 | tee | ||
| 56 | |||
| 57 | with_paren = (a + b * | ||
| 58 | c * d + | ||
| 59 | 12) | ||
| 60 | |||
| 61 | without_paren = a + b * | ||
| 62 | c * d + | ||
| 63 | 12 | ||
| 64 | |||
| 65 | {'a' => { | ||
| 66 | 'b' => 'c', | ||
| 67 | 'd' => %w(e f) | ||
| 68 | } | ||
| 69 | } | ||
| 70 | |||
| 71 | [1, 2, { | ||
| 72 | 'b' => 'c', | ||
| 73 | 'd' => %w(e f) | ||
| 74 | } | ||
| 75 | ] | ||
| 76 | |||
| 77 | foo(a, { | ||
| 78 | a: b, | ||
| 79 | c: d | ||
| 80 | }) | ||
| 81 | |||
| 82 | foo(foo, bar: | ||
| 83 | tee) | ||
| 84 | |||
| 85 | foo(foo, :bar => | ||
| 86 | tee) | ||
| 87 | |||
| 88 | # Local Variables: | ||
| 89 | # mode: ruby-ts | ||
| 90 | # ruby-after-operator-indent: t | ||
| 91 | # ruby-block-indent: t | ||
| 92 | # ruby-method-call-indent: t | ||
| 93 | # ruby-method-params-indent: t | ||
| 94 | # End: | ||
diff --git a/test/lisp/progmodes/ruby-ts-mode-tests.el b/test/lisp/progmodes/ruby-ts-mode-tests.el index eaf6367a306..d34c235e82b 100644 --- a/test/lisp/progmodes/ruby-ts-mode-tests.el +++ b/test/lisp/progmodes/ruby-ts-mode-tests.el | |||
| @@ -250,8 +250,12 @@ The whitespace before and including \"|\" on each line is removed." | |||
| 250 | (should (equal (buffer-string) orig)))) | 250 | (should (equal (buffer-string) orig)))) |
| 251 | (kill-buffer buf))))) | 251 | (kill-buffer buf))))) |
| 252 | 252 | ||
| 253 | (ruby-ts-deftest-indent "ruby-method-params-indent.rb") | 253 | (ruby-ts-deftest-indent "ruby-ts.rb") |
| 254 | (ruby-ts-deftest-indent "ruby-after-operator-indent.rb") | ||
| 254 | (ruby-ts-deftest-indent "ruby-block-indent.rb") | 255 | (ruby-ts-deftest-indent "ruby-block-indent.rb") |
| 256 | (ruby-ts-deftest-indent "ruby-method-call-indent.rb") | ||
| 257 | (ruby-ts-deftest-indent "ruby-method-params-indent.rb") | ||
| 258 | (ruby-ts-deftest-indent "ruby-parenless-call-arguments-indent.rb") | ||
| 255 | 259 | ||
| 256 | (provide 'ruby-ts-mode-tests) | 260 | (provide 'ruby-ts-mode-tests) |
| 257 | 261 | ||
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index e5de8f3464a..9d4bbf3e040 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el | |||
| @@ -8315,29 +8315,35 @@ dicta sunt, explicabo. ")) | |||
| 8315 | (remove-hook 'buffer-list-update-hook bluh)))) | 8315 | (remove-hook 'buffer-list-update-hook bluh)))) |
| 8316 | 8316 | ||
| 8317 | (ert-deftest buffer-tests-inhibit-buffer-hooks-indirect () | 8317 | (ert-deftest buffer-tests-inhibit-buffer-hooks-indirect () |
| 8318 | "Indirect buffers do not call `get-buffer-create'." | 8318 | "Test `make-indirect-buffer' argument INHIBIT-BUFFER-HOOKS." |
| 8319 | (dolist (inhibit '(nil t)) | 8319 | (let* ( base run-bluh run-kbh run-kbqf |
| 8320 | (let ((base (get-buffer-create "foo" inhibit))) | 8320 | (bluh (lambda () (setq run-bluh t))) |
| 8321 | (kbh (lambda () (setq run-kbh t))) | ||
| 8322 | (kbqf (lambda () (setq run-kbqf t)))) | ||
| 8323 | (dolist (inhibit-base '(nil t)) | ||
| 8321 | (unwind-protect | 8324 | (unwind-protect |
| 8322 | (dotimes (_i 11) | 8325 | (let (indirect) |
| 8323 | (let* (flag* | 8326 | (setq base (generate-new-buffer " base" inhibit-base)) |
| 8324 | (flag (lambda () (prog1 t (setq flag* t)))) | 8327 | (dolist (inhibit-indirect '(nil t)) |
| 8325 | (indirect (make-indirect-buffer base "foo[indirect]" nil | 8328 | (dotimes (_ 11) |
| 8326 | inhibit))) | 8329 | (unwind-protect |
| 8327 | (unwind-protect | 8330 | (let ((name (generate-new-buffer-name " indirect"))) |
| 8328 | (progn | 8331 | (setq run-bluh nil run-kbh nil run-kbqf nil) |
| 8329 | (with-current-buffer indirect | 8332 | (add-hook 'buffer-list-update-hook bluh) |
| 8330 | (add-hook 'kill-buffer-query-functions flag nil t)) | 8333 | (with-current-buffer |
| 8331 | (kill-buffer indirect) | 8334 | (setq indirect (make-indirect-buffer |
| 8332 | (if inhibit | 8335 | base name nil inhibit-indirect)) |
| 8333 | (should-not flag*) | 8336 | (add-hook 'kill-buffer-hook kbh nil t) |
| 8334 | (should flag*))) | 8337 | (add-hook 'kill-buffer-query-functions kbqf nil t) |
| 8335 | (let (kill-buffer-query-functions) | 8338 | (kill-buffer)) |
| 8339 | (should (xor inhibit-indirect run-bluh)) | ||
| 8340 | (should (xor inhibit-indirect run-kbh)) | ||
| 8341 | (should (xor inhibit-indirect run-kbqf))) | ||
| 8342 | (remove-hook 'buffer-list-update-hook bluh) | ||
| 8336 | (when (buffer-live-p indirect) | 8343 | (when (buffer-live-p indirect) |
| 8337 | (kill-buffer indirect)))))) | 8344 | (kill-buffer indirect)))))) |
| 8338 | (let (kill-buffer-query-functions) | 8345 | (when (buffer-live-p base) |
| 8339 | (when (buffer-live-p base) | 8346 | (kill-buffer base)))))) |
| 8340 | (kill-buffer base))))))) | ||
| 8341 | 8347 | ||
| 8342 | (ert-deftest zero-length-overlays-and-not () | 8348 | (ert-deftest zero-length-overlays-and-not () |
| 8343 | (with-temp-buffer | 8349 | (with-temp-buffer |