Skip to content

Commit

Permalink
add comments to test
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Feb 14, 2023
1 parent 397f4fd commit 81e671a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/Format.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ makeLenses ''PosTest
root :: Path Abs Dir
root = relToProject $(mkRelDir "tests/positive")

-- Fix empty comments
renderCodeNew :: (HasLoc c, P.PrettyPrint c) => c -> Text
renderCodeNew = prettyText . P.ppOutDefault emptyComments
renderCode :: (HasLoc a, P.PrettyPrint a) => P.Comments -> a -> Text
renderCode c = prettyText . P.ppOutDefault c

type Pipe =
'[ PathResolver,
Expand Down Expand Up @@ -66,7 +65,7 @@ testDescr PosTest {..} =
)

let formatted :: Text
formatted = renderCodeNew (s ^. Scoper.mainModule)
formatted = renderCode (s ^. Scoper.comments) (s ^. Scoper.mainModule)

step "Format"
assertEqDiffText "check: pretty . scope . parse = id" original formatted
Expand Down

0 comments on commit 81e671a

Please sign in to comment.