[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 03f8dca 32/40: tests: Add line wrapping tests
From: |
Daiki Ueno |
Subject: |
[elpa] master 03f8dca 32/40: tests: Add line wrapping tests |
Date: |
Fri, 22 Jan 2016 22:48:46 +0000 |
branch: master
commit 03f8dca09e2498b8325b3583d481ef33c84bf2f0
Author: Daiki Ueno <address@hidden>
Commit: Daiki Ueno <address@hidden>
tests: Add line wrapping tests
---
gnome-c-tests.el | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/gnome-c-tests.el b/gnome-c-tests.el
index 59ae8ee..3b48463 100644
--- a/gnome-c-tests.el
+++ b/gnome-c-tests.el
@@ -78,6 +78,34 @@ int *bar (const char * const **a,
int b);
")
+(defconst gnome-c-test-program-6 "\
+int foo (char **a, int b);
+type_1234567890 bar (char a, int b);
+int identifier_1234567890 (double a, double b);
+")
+
+(defconst gnome-c-test-program-6-aligned-1 "\
+int foo
+ (char **a,
+ int b);
+type_1234567890 bar
+ (char a,
+ int b);
+int identifier_1234567890
+ (double a,
+ double b);
+")
+
+(defconst gnome-c-test-program-6-aligned-2 "\
+int foo (char **a,
+ int b);
+type_1234567890 bar (char a,
+ int b);
+int identifier_1234567890
+ (double a,
+ double b);
+")
+
(ert-deftest gnome-c-test-align--guess-optimal-columns ()
"Tests the `gnome-c-align--guess-optimal-columns'."
(with-temp-buffer
@@ -120,6 +148,26 @@ int *bar (const char * const **a,
(gnome-c-align-decls-region (point-min) (point-max)))
(should (equal (buffer-string) gnome-c-test-program-5-aligned))))
+(ert-deftest gnome-c-test-align-region-4 ()
+ "Tests the `gnome-c-align-decls-region', with max columns set."
+ (with-temp-buffer
+ (insert gnome-c-test-program-6)
+ (c-mode)
+ (let ((gnome-c-align-max-column 20))
+ (gnome-c-align-guess-optimal-columns (point-min) (point-max))
+ (gnome-c-align-decls-region (point-min) (point-max)))
+ (should (equal (buffer-string) gnome-c-test-program-6-aligned-1))))
+
+(ert-deftest gnome-c-test-align-region-5 ()
+ "Tests the `gnome-c-align-decls-region', with max columns set."
+ (with-temp-buffer
+ (insert gnome-c-test-program-6)
+ (c-mode)
+ (let ((gnome-c-align-max-column 30))
+ (gnome-c-align-guess-optimal-columns (point-min) (point-max))
+ (gnome-c-align-decls-region (point-min) (point-max)))
+ (should (equal (buffer-string) gnome-c-test-program-6-aligned-2))))
+
(ert-deftest gnome-c-test-align-guess-columns-1 ()
"Tests the `gnome-c-align-guess-columns'."
(with-temp-buffer
- [elpa] master 1e67806 19/40: snippet: Make options customizable, (continued)
- [elpa] master 1e67806 19/40: snippet: Make options customizable, Daiki Ueno, 2016/01/22
- [elpa] master e8714b1 13/40: align: -guess-columns -> -compute-optimal-columns, Daiki Ueno, 2016/01/22
- [elpa] master abb9dd4 21/40: Revert "align: Add a room before '*' for arguments", Daiki Ueno, 2016/01/22
- [elpa] master d608680 20/40: align: Add a room before '*' for arguments, Daiki Ueno, 2016/01/22
- [elpa] master 147931d 27/40: Fix typo, Daiki Ueno, 2016/01/22
- [elpa] master ec40108 23/40: align: Use `max' as much as possible, Daiki Ueno, 2016/01/22
- [elpa] master d6d27bd 22/40: align: Reimplement d6086809, Daiki Ueno, 2016/01/22
- [elpa] master ccb6062 24/40: tests: Bind `gnome-align-max-column', Daiki Ueno, 2016/01/22
- [elpa] master f339477 28/40: Add references to developer.gnome.org, Daiki Ueno, 2016/01/22
- [elpa] master 78a0cce 31/40: align: Fix `max' usage, Daiki Ueno, 2016/01/22
- [elpa] master 03f8dca 32/40: tests: Add line wrapping tests,
Daiki Ueno <=
- [elpa] master a65924c 26/40: align: Remove spaces between two '*', Daiki Ueno, 2016/01/22
- [elpa] master 39e7fb6 29/40: Rename some commands, Daiki Ueno, 2016/01/22
- [elpa] master 570b52f 30/40: snippet: Fix indentation, Daiki Ueno, 2016/01/22
- [elpa] master e84487c 35/40: snippet: Add FIXME comment, Daiki Ueno, 2016/01/22
- [elpa] master b04d18e 33/40: Change copyright holder to FSF, Daiki Ueno, 2016/01/22
- [elpa] master 06c8a6a 38/40: * packages/gnome-c-style/gnome-c-tests.el: Really add copyright blurb, Daiki Ueno, 2016/01/22
- [elpa] master 8d0f8c1 37/40: Fix command names in comment, Daiki Ueno, 2016/01/22
- [elpa] master b26ba73 34/40: snippet: Add missing GObjectClass vfunc, Daiki Ueno, 2016/01/22
- [elpa] master 1054ea1 39/40: Add links to GNOME programming guideline, Daiki Ueno, 2016/01/22
- [elpa] master 957d395 36/40: maint: Fix license notice, Daiki Ueno, 2016/01/22