Skip to content

Commit 2a61f99

Browse files
committed
purs-tidy format-in-place src test bench
1 parent 0dbfe47 commit 2a61f99

File tree

2 files changed

+36
-34
lines changed

2 files changed

+36
-34
lines changed

Diff for: test/Test/IndentationTests.purs

+35-33
Original file line numberDiff line numberDiff line change
@@ -59,28 +59,28 @@ testIndentationParser :: TestM
5959
testIndentationParser = do
6060
parseTest
6161
( joinWith "\n"
62-
[ "k \n"
63-
, " a1 \n"
64-
, " a2 \n"
65-
, " b1 \n"
66-
, " a3 \n"
67-
, " haha \n"
68-
, " it \n"
69-
, " works \n"
70-
, " "
71-
]
62+
[ "k \n"
63+
, " a1 \n"
64+
, " a2 \n"
65+
, " b1 \n"
66+
, " a3 \n"
67+
, " haha \n"
68+
, " it \n"
69+
, " works \n"
70+
, " "
71+
]
7272
)
7373
( Taxonomy "k"
74-
[ Taxonomy "a1" []
75-
, Taxonomy "a2"
76-
[ Taxonomy "b1" []
77-
]
78-
, Taxonomy "a3"
79-
[ Taxonomy "haha" []
80-
, Taxonomy "it" []
81-
, Taxonomy "works" []
82-
]
83-
]
74+
[ Taxonomy "a1" []
75+
, Taxonomy "a2"
76+
[ Taxonomy "b1" []
77+
]
78+
, Taxonomy "a3"
79+
[ Taxonomy "haha" []
80+
, Taxonomy "it" []
81+
, Taxonomy "works" []
82+
]
83+
]
8484
)
8585
(pTaxonomy <* eof)
8686

@@ -98,25 +98,27 @@ testIndentationParser = do
9898
eof
9999
pure { x, y, z }
100100

101-
parseErrorTestPositionAndMessage (do
102-
x <- intDecimal
103-
void $ string "\n "
104-
indented *> withPos do
105-
checkIndent -- This should pass.
106-
y <- intDecimal
107-
void $ string "\n"
108-
indented *> withPos do -- indented should fail
109-
z <- intDecimal
110-
eof
111-
pure { x, y, z }
101+
parseErrorTestPositionAndMessage
102+
( do
103+
x <- intDecimal
104+
void $ string "\n "
105+
indented *> withPos do
106+
checkIndent -- This should pass.
107+
y <- intDecimal
108+
void $ string "\n"
109+
indented *> withPos do -- indented should fail
110+
z <- intDecimal
111+
eof
112+
pure { x, y, z }
112113
)
113114
"111\n 222\n333"
114115
"""not indented"""
115116
(Position { column: 1, index: 10, line: 3 })
116117

117118
-- Testing function 'indentParens'
118-
parseTest "(1,2,3)" (fromFoldable ["1", "2", "3"]) $
119-
indentParens $ sepBy (string "1" <|> string "2" <|> string "3") (char ',')
119+
parseTest "(1,2,3)" (fromFoldable [ "1", "2", "3" ])
120+
$ indentParens
121+
$ sepBy (string "1" <|> string "2" <|> string "3") (char ',')
120122

121123
-- doesnt work, dont understand idea of this method
122124
-- parseTest """(\n 1,\n 2,\n 3)""" (fromFoldable ["1", "2", "3"]) $

Diff for: test/Test/Lib.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mkParseTest runParser input expected p = case runParser input p of
2727
Right actual -> do
2828
assert' ("expected output: " <> show expected <> ", actual output: " <> show actual) (expected == actual)
2929
logShow actual
30-
Left err -> assert' (joinWith "\n" $ ["error: " <> show err] <> parseErrorHuman__onlyString input 60 err) false
30+
Left err -> assert' (joinWith "\n" $ [ "error: " <> show err ] <> parseErrorHuman__onlyString input 60 err) false
3131

3232
mkParseErrorTestPosition :: forall s a m. Show a => (s -> ParserT s m a -> Either ParseError a) -> ParserT s m a -> s -> Position -> Effect Unit
3333
mkParseErrorTestPosition runParser p input expected = case runParser input p of

0 commit comments

Comments
 (0)