[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 66cd58a 171/468: Fix test_indentation.sh, add bas
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 66cd58a 171/468: Fix test_indentation.sh, add basic_blocks.lua indentation test |
Date: |
Thu, 5 Aug 2021 04:58:30 -0400 (EDT) |
branch: elpa/lua-mode
commit 66cd58af854aa3d067958c48d688b19c4a5f3813
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
Fix test_indentation.sh, add basic_blocks.lua indentation test
---
test/indentation/basic_blocks.lua | 45 ++++++++++++++++++++++++++++++++
test/indentation/basic_blocks.lua.etalon | 45 ++++++++++++++++++++++++++++++++
test/indentation/test_indentation.sh | 13 ++++++---
3 files changed, 100 insertions(+), 3 deletions(-)
diff --git a/test/indentation/basic_blocks.lua
b/test/indentation/basic_blocks.lua
new file mode 100644
index 0000000..2131dbc
--- /dev/null
+++ b/test/indentation/basic_blocks.lua
@@ -0,0 +1,45 @@
+do
+a = 2
+c = 5
+end
+
+if good then
+do_good()
+elseif bad then
+do_bad()
+else
+do_nothing()
+really_do_nothing()
+end
+
+while true do
+sun.rise_in_the_east()
+end
+
+repeat
+host.offer_hot_beverage(guest)
+until guest.good
+
+for i,v in ipairs(base) do
+take(base)
+end
+
+function fact(i)
+if i == 0 then
+return 1
+else
+if i == 1 then
+return 1
+else
+if i == 2 then
+return 2
+else
+fact = 2
+for n=3,i do
+fact = fact * n
+end
+return fact
+end
+end
+end
+end
diff --git a/test/indentation/basic_blocks.lua.etalon
b/test/indentation/basic_blocks.lua.etalon
new file mode 100644
index 0000000..51fa544
--- /dev/null
+++ b/test/indentation/basic_blocks.lua.etalon
@@ -0,0 +1,45 @@
+do
+ a = 2
+ c = 5
+end
+
+if good then
+ do_good()
+elseif bad then
+ do_bad()
+else
+ do_nothing()
+ really_do_nothing()
+end
+
+while true do
+ sun.rise_in_the_east()
+end
+
+repeat
+ host.offer_hot_beverage(guest)
+until guest.good
+
+for i,v in ipairs(base) do
+ take(base)
+end
+
+function fact(i)
+ if i == 0 then
+ return 1
+ else
+ if i == 1 then
+ return 1
+ else
+ if i == 2 then
+ return 2
+ else
+ fact = 2
+ for n=3,i do
+ fact = fact * n
+ end
+ return fact
+ end
+ end
+ end
+end
diff --git a/test/indentation/test_indentation.sh
b/test/indentation/test_indentation.sh
index 799c98e..040faeb 100755
--- a/test/indentation/test_indentation.sh
+++ b/test/indentation/test_indentation.sh
@@ -8,7 +8,7 @@ declare -a PARAMS
PARAMS=( "$@" )
set ${EMACS=emacs}
-set ${LUA_MODE=$(dirname $0)/../lua-mode.el}
+set ${LUA_MODE=$(dirname $0)/../../lua-mode.el}
if [ ${#PARAMS[@]} -eq 0 ]; then
cat <<EOF
@@ -54,9 +54,16 @@ test_file_indentation() {
--load $LUA_MODE \
--eval "(setq make-backup-files nil)" \
--eval "\
-(progn
- (find-file \"$INPUT\")
+(with-temp-buffer
+ ;; lua-mode indents by 3s, that's not even a multiple of tab width (4/8)
+ (set-default 'indent-tabs-mode nil) \
+ (insert-file-contents \"$INPUT\")
(lua-mode)
+
+ ;; permit unsafe (e.g. lua-*) local variables and read them
+ (setq enable-local-variables :all)
+ (hack-local-variables)
+
(indent-region (point-min) (point-max))
(write-file \"$OUTPUT\"))" \
> $ERROR_LOG 2>&1 \
- [nongnu] elpa/lua-mode dfdbd85 143/468: lua-cont-eol-regexp: add missing keywords "if", "until" and "elseif", (continued)
- [nongnu] elpa/lua-mode dfdbd85 143/468: lua-cont-eol-regexp: add missing keywords "if", "until" and "elseif", Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 612b1e7 166/468: Fixed misplaced paranthesis., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4a203b9 172/468: add lua-send-defun (a lua-send-proc replacement), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 58da3f9 066/468: Remove comment about setting lua-mode-map: not required anymore, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e3a4390 092/468: lua-mark-all-multiline-literals: add default keybinding "lua-prefix C-; ", Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode fa1ef23 107/468: lua-mode-map: dont evaluate at compile-time (fix byte-compilation error), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e9a17ba 120/468: Added autoload for (add-to-list 'interpreter-mode-alist '("lua" . lua-mode)), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 509700f 130/468: lua--automark-update-start-pos: rewind to beginning of line to make sure newly inserted multiline literal delimiters are recognized, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 066d042 139/468: Merge pull request #12 from vhallac/vh-indentation-mods, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 39cf29e 141/468: Whoops! Add missing parenthesis, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 66cd58a 171/468: Fix test_indentation.sh, add basic_blocks.lua indentation test,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 4b27305 097/468: Add safe default target to makefile, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ddcd8b8 102/468: Makefile: specify dist contents explicitly, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode aa10440 148/468: Bump TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8638475 174/468: Fix use of flet for Emacs > 24.1, and enable assert., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode f926323 180/468: Extend and unify backward compatibility code, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6245e50 190/468: Add helper functions for reimplementation of font-lock-keywords, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 40c00bf 189/468: lua-font-lock-keywords: fontify constants/builtins first, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3a3f0b0 193/468: Improve local var assignment matching, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode af50eca 195/468: Bump copyright information (no luck with FSF), rephrase comment, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 918f297 072/468: rename: lua-calculate-indentation-left-shift -> lua-calculate-unindentation, Philip Kaludercic, 2021/08/05