emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/dart-mode d3d3d7e 188/192: Add indentation tests


From: ELPA Syncer
Subject: [nongnu] elpa/dart-mode d3d3d7e 188/192: Add indentation tests
Date: Sun, 29 Aug 2021 11:02:15 -0400 (EDT)

branch: elpa/dart-mode
commit d3d3d7e1ad0c524d967a6f8528bd883d2a7fdd45
Author: Brady Trainor <mail@bradyt.net>
Commit: Brady Trainor <mail@bradyt.net>

    Add indentation tests
---
 Makefile                            | 11 +++++++++--
 test/{test.el => test-font-lock.el} |  0
 test/test-indentation.el            | 20 ++++++++++++++++++++
 3 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 4e9a0ac..ac59e2b 100644
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,15 @@ package-lint: .cask
 dart-mode.elc:
        emacs -batch -f batch-byte-compile dart-mode.el
 
-test: .cask dart-mode.elc
-       cask emacs -batch -l dart-mode.elc -l ert -l test/test.el -f 
ert-run-tests-batch-and-exit
+test-setup: .cask dart-mode.elc
+
+test-font-lock: test-setup
+       cask emacs -batch -l dart-mode.elc -l ert -l test/test-font-lock.el -f 
ert-run-tests-batch-and-exit
+
+test-indentation: test-setup
+       cask emacs -batch -l dart-mode.elc -l ert -l test/test-indentation.el 
-f ert-run-tests-batch-and-exit
+
+test: test-font-lock test-indentation
 
 checkdoc:
        emacs -batch -eval "(when (>= emacs-major-version 25) (checkdoc-file 
\"dart-mode.el\"))"
diff --git a/test/test.el b/test/test-font-lock.el
similarity index 100%
rename from test/test.el
rename to test/test-font-lock.el
diff --git a/test/test-indentation.el b/test/test-indentation.el
new file mode 100644
index 0000000..821aaaf
--- /dev/null
+++ b/test/test-indentation.el
@@ -0,0 +1,20 @@
+
+(defun dart-ert-test-indentation-of-file (file)
+  (with-temp-buffer
+    (insert-file-contents file)
+    (let ((orig-length (buffer-size)))
+      (dart-mode)
+      (let ((inhibit-message t))
+        (indent-region (point-min) (point-max)))
+      (= (buffer-size) orig-length))))
+
+(ert-deftest dart-indentation-test ()
+  (should (dart-ert-test-indentation-of-file 
"test/faceup/language-samples/classes.dart"))
+  (should (dart-ert-test-indentation-of-file 
"test/faceup/language-samples/comments.dart"))
+  (should (dart-ert-test-indentation-of-file 
"test/faceup/language-samples/control-flow-statements.dart"))
+  (should (dart-ert-test-indentation-of-file 
"test/faceup/language-samples/exceptions.dart"))
+  (should (dart-ert-test-indentation-of-file 
"test/faceup/language-samples/functions.dart"))
+  (should (dart-ert-test-indentation-of-file 
"test/faceup/language-samples/hello-world.dart"))
+  (should (dart-ert-test-indentation-of-file 
"test/faceup/language-samples/imports.dart"))
+  (should (dart-ert-test-indentation-of-file 
"test/faceup/language-samples/interfaces-and-abstract-classes.dart"))
+  (should (dart-ert-test-indentation-of-file 
"test/faceup/language-samples/variables.dart")))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]