[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 2060f7a 092/385: thoughts on indentation
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 2060f7a 092/385: thoughts on indentation testing |
Date: |
Tue, 5 Oct 2021 23:59:08 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 2060f7a4c25d90770e587a49551a1668aea25a2c
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
thoughts on indentation testing
---
test/haskell-tng-indent-test.el | 31 +++++++++++++++++++++++++++++++
test/haskell-tng-lexer-test.el | 10 ++++++----
2 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/test/haskell-tng-indent-test.el b/test/haskell-tng-indent-test.el
new file mode 100644
index 0000000..7c8321d
--- /dev/null
+++ b/test/haskell-tng-indent-test.el
@@ -0,0 +1,31 @@
+;;; haskell-tng-indent-test.el --- Tests for indentation -*- lexical-binding:
t -*-
+
+;; Copyright (C) 2019 Tseen She
+;; License: GPL 3 or any later version
+
+(require 'ert)
+(require 's)
+
+(require 'haskell-tng-mode)
+
+(require 'haskell-tng-testutils
+ "test/haskell-tng-testutils.el")
+
+(ert-deftest haskell-tng-indent-file-tests ()
+ ;; FIXME four kinds of indentation test:
+ ;;
+ ;; 1. newline-and-indent when writing code
+ ;; 2. ... with subsequent indent-line-function cycles
+ ;; 3. indent-line-function at the beginning of an existing line
+ ;; 4. ... with subsequent indent-line-function cycles
+ ;;
+ ;; Expectations could use lines of | and . to indicate where the
+ ;; indentation(s) go. 1 and 2 are the most interesting so could be combined
+ ;; into one test. 3 and 4 could also be combined.
+ ;;
+ ;; (should (have-expected-newline-indent (testdata "src/layout.hs")))
+ ;; (should (have-expected-indent (testdata "src/layout.hs")))
+
+ )
+
+;;; haskell-tng-indent-test.el ends here
diff --git a/test/haskell-tng-lexer-test.el b/test/haskell-tng-lexer-test.el
index fcc48e0..1e8044b 100644
--- a/test/haskell-tng-lexer-test.el
+++ b/test/haskell-tng-lexer-test.el
@@ -1,4 +1,4 @@
-;;; haskell-tng-lexer-test.el --- Tests for navigation and indentation -*-
lexical-binding: t -*-
+;;; haskell-tng-lexer-test.el --- Tests for the SMIE lexer -*-
lexical-binding: t -*-
;; Copyright (C) 2018-2019 Tseen She
;; License: GPL 3 or any later version
@@ -12,11 +12,11 @@
"test/haskell-tng-testutils.el")
(ert-deftest haskell-tng-lexer-file-tests ()
- (should (have-expected-forward-lex (testdata "src/medley.hs")))
(should (have-expected-forward-lex (testdata "src/layout.hs")))
+ (should (have-expected-forward-lex (testdata "src/medley.hs")))
- (should (have-expected-backward-lex (testdata "src/medley.hs")))
(should (have-expected-backward-lex (testdata "src/layout.hs")))
+ (should (have-expected-backward-lex (testdata "src/medley.hs")))
)
(ert-deftest haskell-tng-lexer-state-invalidation-tests ()
@@ -126,7 +126,9 @@
"ยง")
(t (error "Unknown token: '%s' with '%S'"
(string (char-before))
- (syntax-before (point)))))))
+ (progn
+ (backward-char)
+ (syntax-after (point))))))))
(defun haskell-tng-lexer-test:tokens (&optional reverse)
"Lex the current buffer using SMIE and return the list of lines,
- [nongnu] elpa/haskell-tng-mode 41a29dd 066/385: backward lexer, (continued)
- [nongnu] elpa/haskell-tng-mode 41a29dd 066/385: backward lexer, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c48e7a5 069/385: starting to transcribe the expression table, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1f1110a 073/385: transcribe the grammar rules, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 01789b1 075/385: y u no haskell-mode?, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b8f3e3f 079/385: back out incomplete grammar rules, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9e19b2b 080/385: double down on simpler grammar, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6e7a24f 083/385: lexer identifies conid / varid, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b12e49a 086/385: consym, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7d6fa3d 091/385: thoughts on lexers, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6a05d12 090/385: planning for indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2060f7a 092/385: thoughts on indentation testing,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 6d2d764 094/385: skeleton for indentation tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 0d04664 115/385: implement batch compilation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode adb3c50 143/385: better insert indentation suggestions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e79577e 132/385: match ghc source paths when compiling, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8ec4807 145/385: somehow dropped font-lock-extend-region-multiline, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d3a6a22 147/385: no todos in the test/src dir, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 85f20b1 154/385: indent coproducts, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3dbb883 013/385: more progress on multiline type expansion, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c6382e1 036/385: almost got it with imports, then I lost it..., ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f3e3838 070/385: starting to transcribe the expression table, ELPA Syncer, 2021/10/06