]> git.eshelyaron.com Git - emacs.git/commitdiff
Add python-mode tests for align.el
authorStefan Kangas <stefankangas@gmail.com>
Wed, 2 Aug 2023 22:48:23 +0000 (00:48 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Wed, 2 Aug 2023 22:49:02 +0000 (00:49 +0200)
* test/lisp/align-tests.el (align-python): New test.
* test/lisp/align-resources/python-mode.erts: New file.

test/lisp/align-resources/python-mode.erts [new file with mode: 0644]
test/lisp/align-tests.el

diff --git a/test/lisp/align-resources/python-mode.erts b/test/lisp/align-resources/python-mode.erts
new file mode 100644 (file)
index 0000000..1ce50b3
--- /dev/null
@@ -0,0 +1,29 @@
+Name: align assignments
+
+=-=
+foo = "bar"
+x = 1
+zzzzz = True
+y        = None
+=-=
+foo   = "bar"
+x     = 1
+zzzzz = True
+y     = None
+=-=-=
+
+Name: python-chain-logic and basic-line-continuation
+
+=-=
+if foo or\
+   b and \
+   bcxxx and \
+   c:
+    pass
+=-=
+if foo   or  \
+   b     and \
+   bcxxx and \
+   c:
+    pass
+=-=-=
index 52e136abfc856e3862d4d77cc1c2703f12a14f36..90b6b9df9bff241217f785c94d096002e021e352 100644 (file)
   (ert-test-erts-file (ert-resource-file "java-mode.erts")
                       (test-align-transform-fun #'java-mode)))
 
+(ert-deftest align-python ()
+  (ert-test-erts-file (ert-resource-file "python-mode.erts")
+                      (test-align-transform-fun #'python-mode)))
+
 (ert-deftest align-toml ()
   (let ((indent-tabs-mode nil))
     (ert-test-erts-file (ert-resource-file "conf-toml-mode.erts")