[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode 710f5425a4 189/222: Add tests for typescri
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode 710f5425a4 189/222: Add tests for typescript-indent-list-items option |
Date: |
Sun, 6 Feb 2022 16:59:31 -0500 (EST) |
branch: elpa/typescript-mode
commit 710f5425a439a2cdde01681e95d907c1fa3729be
Author: Ivan Sokolov <ivan-p-sokolov@ya.ru>
Commit: Ivan Sokolov <ivan-p-sokolov@ya.ru>
Add tests for typescript-indent-list-items option
---
test-files/list-items-indent-comma-first.ts | 10 ++++-----
test-files/list-items-indent-default.ts | 22 +++++++++++++++++++
typescript-mode-general-tests.el | 34 +++++++++++++++++++++++++++++
3 files changed, 61 insertions(+), 5 deletions(-)
diff --git a/test-files/list-items-indent-comma-first.ts
b/test-files/list-items-indent-comma-first.ts
index 565489ead4..2a7485c89c 100644
--- a/test-files/list-items-indent-comma-first.ts
+++ b/test-files/list-items-indent-comma-first.ts
@@ -15,8 +15,8 @@ const depth = { arr: [ 'one'
, b: 222
, c: 333 }
, func_call: Object.assign
- ( {}
- , { x: 1
- , y: 2
- , z: 3 }
- , { i: 'i', j: 'j' } ) };
+ ( {}
+ , { x: 1
+ , y: 2
+ , z: 3 }
+ , { i: 'i', j: 'j' } ) };
diff --git a/test-files/list-items-indent-default.ts
b/test-files/list-items-indent-default.ts
new file mode 100644
index 0000000000..290c8250dc
--- /dev/null
+++ b/test-files/list-items-indent-default.ts
@@ -0,0 +1,22 @@
+const arr =
+ [ 'one'
+ , 'two'
+ , 'three' ];
+
+const obj =
+ { a: 111
+ , b: 222
+ , c: 333 };
+
+const depth = { arr: [ 'one'
+ , 'two'
+ , 'three' ]
+ , obj: { a: 111
+ , b: 222
+ , c: 333 }
+ , func_call: Object.assign
+ ( {}
+ , { x: 1
+ , y: 2
+ , z: 3 }
+ , { i: 'i', j: 'j' } ) };
diff --git a/typescript-mode-general-tests.el b/typescript-mode-general-tests.el
index 6e3f098aa7..aa1f1f8c78 100644
--- a/typescript-mode-general-tests.el
+++ b/typescript-mode-general-tests.el
@@ -52,6 +52,40 @@
(typescript-test-get-doc))))
(kill-buffer buffer)))
+(ert-deftest list-items-indent-default ()
+ (with-current-buffer (find-file "test-files/list-items-indent-default.ts")
+ (typescript-mode)
+ (let ((test-reference (typescript-test-get-doc)))
+ (typescript-test-indent-all)
+ (should (string= test-reference (typescript-test-get-doc))))
+ (kill-buffer)))
+
+(ert-deftest list-items-indent-default-not-comma-first ()
+ (with-current-buffer (find-file
"test-files/list-items-indent-comma-first.ts")
+ (typescript-mode)
+ (let ((test-reference (typescript-test-get-doc)))
+ (typescript-test-indent-all)
+ (should (not (string= test-reference (typescript-test-get-doc)))))
+ (kill-buffer)))
+
+(ert-deftest list-items-indent-comma-first ()
+ (with-current-buffer (find-file
"test-files/list-items-indent-comma-first.ts")
+ (typescript-mode)
+ (let ((test-reference (typescript-test-get-doc))
+ (typescript-indent-list-items nil))
+ (typescript-test-indent-all)
+ (should (string= test-reference (typescript-test-get-doc))))
+ (kill-buffer)))
+
+(ert-deftest list-items-indent-comma-first-not-default ()
+ (with-current-buffer (find-file "test-files/list-items-indent-default.ts")
+ (typescript-mode)
+ (let ((test-reference (typescript-test-get-doc))
+ (typescript-indent-list-items nil))
+ (typescript-test-indent-all)
+ (should (not (string= test-reference (typescript-test-get-doc)))))
+ (kill-buffer)))
+
(defun get-all-matched-strings (to-match)
(let (result)
(dotimes (x (/ (length (match-data)) 2))
- [nongnu] elpa/typescript-mode 85504ce34b 138/222: Update build-badge URL., (continued)
- [nongnu] elpa/typescript-mode 85504ce34b 138/222: Update build-badge URL., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f6330f420e 144/222: Add a test for #107., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c1aa1b2e7d 149/222: add better generics highlighting, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1bafd279cf 148/222: Enable more colors (#110), ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 607897d583 151/222: Update Emacs Git to Xenial-build, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 42b366e669 153/222: Merge pull request #111 from tam5/master, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2405090403 152/222: Handle CI-failures correctly., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 895cd7f425 173/222: Fix indentation infinite looping, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 9db704ec1f 185/222: Fix duplicate test name, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4832652496 163/222: Support electric-layout-mode., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 710f5425a4 189/222: Add tests for typescript-indent-list-items option,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 1fd835e7f8 205/222: Fix typos in README, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 30391a518a 079/222: Fix indentation issue with conditional operators., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2d382d8bfb 053/222: Support rule names and severity in tslint reports., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 83579fac6e 070/222: Remove the explicit invocation of the mode hook., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e700af4703 092/222: Use syntax-propertize-function to fontify regexps., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1d32c6b3a8 066/222: Improve readability of the code., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 46e032e932 054/222: Fix list of values compilation mode should use., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 56a1ea861f 082/222: Merge pull request #55 from bkruczyk/fix-regex-font-locking, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 0353bd72f8 133/222: Add bigint, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 18dc5a36a6 140/222: Fixes typo in the README file., ELPA Syncer, 2022/02/06