emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-tng-mode 8b5a4d4 177/385: improve indentation test


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode 8b5a4d4 177/385: improve indentation tests
Date: Tue, 5 Oct 2021 23:59:26 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit 8b5a4d4cc23138d8fc118a8bd74a0c820d12873d
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>

    improve indentation tests
---
 test/haskell-tng-indent-test.el       |  1 +
 test/src/indentation.hs               | 14 ++++++++++----
 test/src/indentation.hs.append.indent | 32 +++++++++++++++++++++----------
 test/src/indentation.hs.insert.indent | 32 +++++++++++++++++++++----------
 test/src/indentation.hs.layout        | 14 ++++++++++----
 test/src/indentation.hs.lexer         | 10 ++++++++--
 test/src/indentation.hs.reindent      | 36 +++++++++++++++++++++++------------
 test/src/indentation.hs.sexps         | 14 ++++++++++----
 test/src/indentation.hs.syntax        | 12 +++++++++---
 9 files changed, 116 insertions(+), 49 deletions(-)

diff --git a/test/haskell-tng-indent-test.el b/test/haskell-tng-indent-test.el
index b2fdb09..4c0e51c 100644
--- a/test/haskell-tng-indent-test.el
+++ b/test/haskell-tng-indent-test.el
@@ -15,6 +15,7 @@
 ;; FIXME implement more indentation rules
 ;;
 ;; TODO multiline type signatures
+;; TODO user config for typesig preference (incompatible versions)
 ;; TODO ImplicitParams in type signatures (without parens)
 ;; TODO if/then/else
 
diff --git a/test/src/indentation.hs b/test/src/indentation.hs
index c962b82..18a7ee3 100644
--- a/test/src/indentation.hs
+++ b/test/src/indentation.hs
@@ -122,15 +122,21 @@ tuples2 = (
 tuples3 = ( foo ,
             bar )
 
-types1 :: a -> b -> c
+typesig :: a -> b -> c
+
+types1 ::
+     Monad m
+  => a
+  -> b
+  -> c
 
 types2 ::
-     a
+   ( Monad m )
+  => a
   -> b
   -> c
 
-types3 ::
-     Monad m
+types3 :: (Monad m, MemberLogger m)
   => a
   -> b
   -> c
diff --git a/test/src/indentation.hs.append.indent 
b/test/src/indentation.hs.append.indent
index 035ccf8..777e1ee 100644
--- a/test/src/indentation.hs.append.indent
+++ b/test/src/indentation.hs.append.indent
@@ -246,32 +246,44 @@ tuples3 = ( foo ,
 v           1
 
 v           1
-types1 :: a -> b -> c
+typesig :: a -> b -> c
 v
 
 v
-types2 ::
+types1 ::
 1    v
-     a
+     Monad m
 2 v  1
+  => a
+1 v  2
   -> b
 v 1  2
   -> c
 v 1  2
 
 v 1  2
-types3 ::
+types2 ::
 1    v
-     Monad m
-2 v  1
+   ( Monad m )
+2 v1
   => a
-1 v  2
+1 v2
   -> b
-v 1  2
+v 12
   -> c
-v 1  2
+v 12
 
-v 1  2
+v 12
+types3 :: (Monad m, MemberLogger m)
+1        v
+  => a
+1 v
+  -> b
+v 1
+  -> c
+v 1
+
+v 1
 types4 :: Monad m
 1        v
        => (?log :: HasLogger m)
diff --git a/test/src/indentation.hs.insert.indent 
b/test/src/indentation.hs.insert.indent
index 5ee213d..cc61e7d 100644
--- a/test/src/indentation.hs.insert.indent
+++ b/test/src/indentation.hs.insert.indent
@@ -246,32 +246,44 @@ tuples3 = ( foo ,
 v           1
 
 v           1
-types1 :: a -> b -> c
+typesig :: a -> b -> c
 v
 
 v
-types2 ::
+types1 ::
 1    v
-     a
+     Monad m
 2 v  1
+  => a
+1 v  2
   -> b
 2 1  v
   -> c
 v 1  2
 
 v 1  2
-types3 ::
-1    v
-     Monad m
-2 v  1
+types2 ::
+2  1 v
+   ( Monad m )
+2 v1
   => a
-1 v  2
+1 v2
+  -> b
+2 13 v
+  -> c
+v 12
+
+v 12
+types3 :: (Monad m, MemberLogger m)
+2 1      v
+  => a
+1 v
   -> b
 2 1  v
   -> c
-v 1  2
+v 1
 
-v 1  2
+v 1
 types4 :: Monad m
 2      1 v
        => (?log :: HasLogger m)
diff --git a/test/src/indentation.hs.layout b/test/src/indentation.hs.layout
index 4eae865..25f1b7b 100644
--- a/test/src/indentation.hs.layout
+++ b/test/src/indentation.hs.layout
@@ -122,15 +122,21 @@ module Indentation where
 ;tuples3 = ( foo ,
             bar )
 
-;types1 :: a -> b -> c
+;typesig :: a -> b -> c
+
+;types1 ::
+     Monad m
+  => a
+  -> b
+  -> c
 
 ;types2 ::
-     a
+   ( Monad m )
+  => a
   -> b
   -> c
 
-;types3 ::
-     Monad m
+;types3 :: (Monad m, MemberLogger m)
   => a
   -> b
   -> c
diff --git a/test/src/indentation.hs.lexer b/test/src/indentation.hs.lexer
index 065623e..85047a2 100644
--- a/test/src/indentation.hs.lexer
+++ b/test/src/indentation.hs.lexer
@@ -125,12 +125,18 @@ VARID »
 ; VARID :: VARID -> VARID -> VARID
 
 ; VARID ::
-VARID
+CONID VARID
+=> VARID
 -> VARID
 -> VARID
 
 ; VARID ::
-CONID VARID
+« CONID VARID »
+=> VARID
+-> VARID
+-> VARID
+
+; VARID :: « CONID VARID , CONID VARID »
 => VARID
 -> VARID
 -> VARID
diff --git a/test/src/indentation.hs.reindent b/test/src/indentation.hs.reindent
index 14fcf7b..2219848 100644
--- a/test/src/indentation.hs.reindent
+++ b/test/src/indentation.hs.reindent
@@ -247,32 +247,44 @@ tuples3 = ( foo ,
 v           1
 
 v           1
-types1 :: a -> b -> c
+typesig :: a -> b -> c
 v
 
 v    1
-types2 ::
+types1 ::
 2 1  v
-     a
-v 1  2
+     Monad m
+2 v  1
+  => a
+1 v  2
   -> b
 1 v  2
   -> c
 v 1  2
 
-v 2  1
-types3 ::
+v 21 3
+types2 ::
 2 1  v
-     Monad m
-2 v  1
+   ( Monad m )
+2 v1
   => a
-1 v  2
+1 v2
   -> b
-1 v  2
+1 v2
   -> c
-v 1  2
+v 12
+
+v 12
+types3 :: (Monad m, MemberLogger m)
+2 1      v
+  => a
+1 v
+  -> b
+1 v
+  -> c
+v 1
 
-v 2  3 1
+v 2    1
 types4 :: Monad m
 2      1 v
        => (?log :: HasLogger m)
diff --git a/test/src/indentation.hs.sexps b/test/src/indentation.hs.sexps
index 2d8db03..0df94ee 100644
--- a/test/src/indentation.hs.sexps
+++ b/test/src/indentation.hs.sexps
@@ -122,15 +122,21 @@
 ((tuples3) = ( (foo) ,
             (bar) ))
 
-((types1) :: (a) -> (b) -> (c))
+((typesig) :: (a) -> (b) -> (c))
+
+((types1) ::
+     (Monad) (m)
+  => (a)
+  -> (b)
+  -> (c))
 
 ((types2) ::
-     (a)
+   ( (Monad) (m) )
+  => (a)
   -> (b)
   -> (c))
 
-((types3) ::
-     (Monad) (m)
+((types3) :: ((Monad) (m), (MemberLogger) (m))
   => (a)
   -> (b)
   -> (c))
diff --git a/test/src/indentation.hs.syntax b/test/src/indentation.hs.syntax
index 4e75ba8..40e2ef0 100644
--- a/test/src/indentation.hs.syntax
+++ b/test/src/indentation.hs.syntax
@@ -122,15 +122,21 @@ wwwwwww _ (>
 wwwwwww _ ( www .>
             www )>
 >
-wwwwww __ w __ w __ w>
+wwwwwww __ w __ w __ w>
 >
 wwwwww __>
-     w>
+     wwwww w>
+  __ w>
   __ w>
   __ w>
 >
 wwwwww __>
-     wwwww w>
+   ( wwwww w )>
+  __ w>
+  __ w>
+  __ w>
+>
+wwwwww __ (wwwww w. wwwwwwwwwwww w)>
   __ w>
   __ w>
   __ w>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]