File: test-indentation.el

package info (click to toggle)
emacs-dart-mode 1.0.7%2Bgit20250423.f82ff05-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 656 kB
  • sloc: lisp: 613; makefile: 29
file content (21 lines) | stat: -rw-r--r-- 1,211 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(require 'dart-mode)

(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")))