Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
started on the pretty print functions
- Loading branch information
Showing
5 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{-# LANGUAGE NamedFieldPuns #-} | ||
|
||
module Language.Gherkin.Pretty where | ||
|
||
import Language.Gherkin.AST | ||
import Text.PrettyPrint | ||
|
||
pretty :: Feature -> Doc | ||
pretty Feature { -- feature_tags | ||
feature_name | ||
, feature_description | ||
-- , feature_background | ||
-- , feature_scenarios | ||
} = text "Feature:" <+> text feature_name $$ nest 4 featureBody | ||
where | ||
featureBody = text feature_description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Instances where | ||
import Test.QuickCheck | ||
import Language.Gherkin | ||
|
||
newtype GF = GF Feature | ||
deriving (Eq, Show) | ||
|
||
instance Arbitrary GF where | ||
arbitrary = return $ GF $ Feature { | ||
feature_tags = [] | ||
, feature_name = "feature" | ||
, feature_description = "description" | ||
, feature_background = Nothing | ||
, feature_scenarios = [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters