Skip to content

Commit

Permalink
tweak tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tek committed Mar 29, 2024
1 parent 714eec6 commit e49120a
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 32 deletions.
33 changes: 29 additions & 4 deletions test/corpus/decl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ a = a

(haskell
(declarations
(function
(variable)
(exp_name
(variable)))
(function
(variable)
(exp_name
(variable)))
(haddock)
(function
(variable)
Expand Down Expand Up @@ -347,3 +347,28 @@ infixl 1 -
(fixity
(integer)
(operator))))

================================================================================
decl: infix function with extra args
================================================================================

(a ++ a) a a = a

--------------------------------------------------------------------------------

(haskell
(declarations
(function
(infix
(pat_name
(variable))
(operator)
(pat_name
(variable)))
(patterns
(pat_name
(variable))
(pat_name
(variable)))
(exp_name
(variable)))))
25 changes: 0 additions & 25 deletions test/corpus/pat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1084,31 +1084,6 @@ a @a (A @a @(a :: a) @(A a :: a) @(∀ a . A a :: a)) = a
(exp_name
(variable)))))

================================================================================
pat: infix function with extra args
================================================================================

(a ++ a) a a = a

--------------------------------------------------------------------------------

(haskell
(declarations
(function
(infix
(pat_name
(variable))
(operator)
(pat_name
(variable)))
(patterns
(pat_name
(variable))
(pat_name
(variable)))
(exp_name
(variable)))))

================================================================================
pat: cond in viewpat
================================================================================
Expand Down
11 changes: 11 additions & 0 deletions test/parse/end_layout_where.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,14 @@ a = do
b
-- a
where c = d

a = do
b
where -- c
d = e

a = do
b
where
-- c
d = e
30 changes: 27 additions & 3 deletions test/parse/end_layout_where.target
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(haskell [0, 0] - [4, 0]
declarations: (declarations [0, 0] - [4, 0]
(haskell [0, 0] - [15, 0]
declarations: (declarations [0, 0] - [15, 0]
(function [0, 0] - [3, 15]
name: (variable [0, 0] - [0, 1])
expression: (exp_do [0, 4] - [1, 3]
Expand All @@ -11,4 +11,28 @@
(function [3, 10] - [3, 15]
name: (variable [3, 10] - [3, 11])
expression: (exp_name [3, 14] - [3, 15]
(variable [3, 14] - [3, 15])))))))
(variable [3, 14] - [3, 15])))))
(function [5, 0] - [8, 9]
name: (variable [5, 0] - [5, 1])
expression: (exp_do [5, 4] - [6, 3]
(exp_statement [6, 2] - [6, 3]
(exp_name [6, 2] - [6, 3]
(variable [6, 2] - [6, 3]))))
(comment [7, 8] - [7, 12])
where: (binds [8, 4] - [8, 9]
(function [8, 4] - [8, 9]
name: (variable [8, 4] - [8, 5])
expression: (exp_name [8, 8] - [8, 9]
(variable [8, 8] - [8, 9])))))
(function [10, 0] - [14, 9]
name: (variable [10, 0] - [10, 1])
expression: (exp_do [10, 4] - [11, 3]
(exp_statement [11, 2] - [11, 3]
(exp_name [11, 2] - [11, 3]
(variable [11, 2] - [11, 3]))))
(comment [13, 4] - [13, 8])
where: (binds [14, 4] - [14, 9]
(function [14, 4] - [14, 9]
name: (variable [14, 4] - [14, 5])
expression: (exp_name [14, 8] - [14, 9]
(variable [14, 8] - [14, 9])))))))

0 comments on commit e49120a

Please sign in to comment.