[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 505896f 386/468: added tests for lua-indent-neste
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 505896f 386/468: added tests for lua-indent-nested-block-content-align and lua-indent-close-paren-align |
Date: |
Thu, 5 Aug 2021 04:59:14 -0400 (EDT) |
branch: elpa/lua-mode
commit 505896fbb771332d99b44c2f3f4e3f406a665a16
Author: edam <tim@ed.am>
Commit: edam <tim@ed.am>
added tests for lua-indent-nested-block-content-align and
lua-indent-close-paren-align
---
test/test-indentation.el | 83 +++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 82 insertions(+), 1 deletion(-)
diff --git a/test/test-indentation.el b/test/test-indentation.el
index 44d2355..6c7c59d 100644
--- a/test/test-indentation.el
+++ b/test/test-indentation.el
@@ -501,10 +501,91 @@ foobar(
b
},
c, d
-)"))))
+)")))
+
+ (it "indent blocks with lua-indent-nested-block-content-align"
+ (let ((lua-indent-nested-block-content-align nil))
+ (expect (lua--reindent-like "\
+call_some_fn( something, {
+ val = 5,
+ another = 6,
+} )"))
+ (expect (lua--reindent-like "\
+local def = {
+ some_very_long_name = { fn =
+ function()
+ return true
+ end
+ }
+}"))
+ ))
+
+ (it "indent blocks with lua-indent-close-paren-align"
+ (let ((lua-indent-close-paren-align nil))
+ (expect (lua--reindent-like "\
+local foo = setmetatable( {
+ a = 4,
+ b = 5,
+}, {
+ __index = some_func,
+} )"))
+ ))
+
+ (it "indents nested tables with alternative block indenting"
+ (let ((lua-indent-nested-block-content-align nil)
+ (lua-indent-close-paren-align nil))
+ (expect (lua--reindent-like "\
+foobar({
+ a, b, c
+})"))
+
+ (expect (lua--reindent-like "\
+foobar(a, {
+ b,
+ c
+})"))
+
+ (expect (lua--reindent-like "\
+foobar(
+ a,
+ {
+ b,
+ c
+})"))
+
+ (expect (lua--reindent-like "\
+foobar(
+ a,
+ {
+ b,
+ c
+ }
+)"))
+ (expect (lua--reindent-like "\
+foobar(a,
+ {
+ b,
+ c
+})"))
+ (expect (lua--reindent-like "\
+foobar(a,
+ {
+ b,
+ c
+ }
+)"))
+ (expect (lua--reindent-like "\
+foobar(
+ {
+ a,
+ b
+ },
+ c, d
+)"))
+ )))
(ert-deftest lua-indentation-defun ()
;; [local] function funcname funcbody
- [nongnu] elpa/lua-mode 4cb20c0 359/468: Cask: specify minimum version for buttercup, (continued)
- [nongnu] elpa/lua-mode 4cb20c0 359/468: Cask: specify minimum version for buttercup, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c850d2e 357/468: test-inferior-process: temporarily disable failing test, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e68bc14 353/468: Remove compatibility for Emacs < 24, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8b66d36 364/468: Merge branch 'master' into master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 95c64bb 366/468: Add doc for lua-find-matching-token-word, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode aee46da 367/468: added lua-indent-nested-block-content-align var, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8503e16 370/468: travis: specify language=minimal explicitly, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c7c3aaa 377/468: Set comint-prompt-regexp locally in process buffer, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 52cc3e4 378/468: Merge pull request #154 from immerrr/set-comint-prompt-regexp-locally-in-process-buf, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0f7f010 383/468: Fix typo, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 505896f 386/468: added tests for lua-indent-nested-block-content-align and lua-indent-close-paren-align,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 0cf8000 387/468: add lua-indent-close-paren-align to README.md, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2a8b58b 390/468: Silence byte-compiler, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 1f596a9 392/468: Merge pull request #161 from tarsiiformes/lexical, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0781d83 404/468: Merge pull request #175 from immerrr/add-lua-backward-up-list-command, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d6dc6fb 406/468: Don't add "continuation line" indentation inside parentheses/brackets, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ed01d35 071/468: Implement proper syntax-status querying: improve precision a lot, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0a1e915 262/468: bug fixes for show/hide process buffer, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6315591 265/468: indentation-test: extend unary op test cases, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6c4f7cb 251/468: lua-default-command-switches: declare buffer-local with make-variable-buffer-local, not make-local-variable, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9117cfc 269/468: Makefile: add tryout target to start editing test.lua, Philip Kaludercic, 2021/08/05