plutus-tx-1.0.0.0: Libraries for Plutus Tx and its prelude
Safe HaskellNone
LanguageHaskell2010

PlutusTx.Coverage

Synopsis

Documentation

data CoverageAnnotation Source #

Instances

Instances details
Eq CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Read CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Show CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Generic CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CoverageAnnotation :: Type -> Type Source #

NFData CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CoverageAnnotation -> () Source #

Serialise CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageAnnotation -> Encoding

decode :: Decoder s CoverageAnnotation

encodeList :: [CoverageAnnotation] -> Encoding

decodeList :: Decoder s [CoverageAnnotation]

Flat CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageAnnotation -> Encoding

decode :: Get CoverageAnnotation

size :: CoverageAnnotation -> NumBits -> NumBits

FromJSON CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser CoverageAnnotation

parseJSONList :: Value -> Parser [CoverageAnnotation]

FromJSONKey CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

fromJSONKey :: FromJSONKeyFunction CoverageAnnotation

fromJSONKeyList :: FromJSONKeyFunction [CoverageAnnotation]

ToJSON CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

ToJSONKey CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

toJSONKey :: ToJSONKeyFunction CoverageAnnotation

toJSONKeyList :: ToJSONKeyFunction [CoverageAnnotation]

Pretty CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

pretty :: CoverageAnnotation -> Doc ann

prettyList :: [CoverageAnnotation] -> Doc ann

type Rep CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

data CoverageIndex Source #

This type keeps track of all coverage annotations and where they have been inserted / what annotations are expected to be found when executing a piece of code.

Instances

Instances details
Eq CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Show CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Generic CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CoverageIndex :: Type -> Type Source #

Semigroup CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Monoid CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

NFData CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CoverageIndex -> () Source #

Serialise CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageIndex -> Encoding

decode :: Decoder s CoverageIndex

encodeList :: [CoverageIndex] -> Encoding

decodeList :: Decoder s [CoverageIndex]

Flat CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageIndex -> Encoding

decode :: Get CoverageIndex

size :: CoverageIndex -> NumBits -> NumBits

FromJSON CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser CoverageIndex

parseJSONList :: Value -> Parser [CoverageIndex]

ToJSON CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

toJSON :: CoverageIndex -> Value

toEncoding :: CoverageIndex -> Encoding

toJSONList :: [CoverageIndex] -> Value

toEncodingList :: [CoverageIndex] -> Encoding

type Rep CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CoverageIndex = D1 ('MetaData "CoverageIndex" "PlutusTx.Coverage" "plutus-tx-1.0.0.0-CTJpb0OSKTj2IwExKen56o" 'False) (C1 ('MetaCons "CoverageIndex" 'PrefixI 'True) (S1 ('MetaSel ('Just "_coverageMetadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CoverageAnnotation CoverageMetadata))))

newtype CoverageMetadata Source #

Constructors

CoverageMetadata 

Fields

Instances

Instances details
Eq CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Show CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Generic CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CoverageMetadata :: Type -> Type Source #

Semigroup CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Monoid CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

NFData CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CoverageMetadata -> () Source #

Serialise CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageMetadata -> Encoding

decode :: Decoder s CoverageMetadata

encodeList :: [CoverageMetadata] -> Encoding

decodeList :: Decoder s [CoverageMetadata]

Flat CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageMetadata -> Encoding

decode :: Get CoverageMetadata

size :: CoverageMetadata -> NumBits -> NumBits

FromJSON CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser CoverageMetadata

parseJSONList :: Value -> Parser [CoverageMetadata]

ToJSON CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Pretty CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

pretty :: CoverageMetadata -> Doc ann

prettyList :: [CoverageMetadata] -> Doc ann

type Rep CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CoverageMetadata = D1 ('MetaData "CoverageMetadata" "PlutusTx.Coverage" "plutus-tx-1.0.0.0-CTJpb0OSKTj2IwExKen56o" 'True) (C1 ('MetaCons "CoverageMetadata" 'PrefixI 'True) (S1 ('MetaSel ('Just "_metadataSet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set Metadata))))

data Metadata Source #

Constructors

ApplicationHeadSymbol String 
IgnoredAnnotation

Location that is not interesting to cover. This is not generated by the compiler, but can be added later using addCoverageMetadata.

Instances

Instances details
Eq Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Ord Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Show Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Generic Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep Metadata :: Type -> Type Source #

NFData Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: Metadata -> () Source #

Serialise Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: Metadata -> Encoding

decode :: Decoder s Metadata

encodeList :: [Metadata] -> Encoding

decodeList :: Decoder s [Metadata]

Flat Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: Metadata -> Encoding

decode :: Get Metadata

size :: Metadata -> NumBits -> NumBits

FromJSON Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser Metadata

parseJSONList :: Value -> Parser [Metadata]

ToJSON Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

toJSON :: Metadata -> Value

toEncoding :: Metadata -> Encoding

toJSONList :: [Metadata] -> Value

toEncodingList :: [Metadata] -> Encoding

Pretty Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

pretty :: Metadata -> Doc ann

prettyList :: [Metadata] -> Doc ann

type Rep Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep Metadata = D1 ('MetaData "Metadata" "PlutusTx.Coverage" "plutus-tx-1.0.0.0-CTJpb0OSKTj2IwExKen56o" 'False) (C1 ('MetaCons "ApplicationHeadSymbol" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "IgnoredAnnotation" 'PrefixI 'False) (U1 :: Type -> Type))

newtype CoverageData Source #

Instances

Instances details
Eq CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Show CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Generic CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CoverageData :: Type -> Type Source #

Semigroup CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Monoid CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

NFData CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CoverageData -> () Source #

FromJSON CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser CoverageData

parseJSONList :: Value -> Parser [CoverageData]

ToJSON CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

toJSON :: CoverageData -> Value

toEncoding :: CoverageData -> Encoding

toJSONList :: [CoverageData] -> Value

toEncodingList :: [CoverageData] -> Encoding

type Rep CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CoverageData = D1 ('MetaData "CoverageData" "PlutusTx.Coverage" "plutus-tx-1.0.0.0-CTJpb0OSKTj2IwExKen56o" 'True) (C1 ('MetaCons "CoverageData" 'PrefixI 'True) (S1 ('MetaSel ('Just "_coveredAnnotations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set CoverageAnnotation))))

data CoverageReport Source #

Instances

Instances details
Eq CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Show CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Generic CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CoverageReport :: Type -> Type Source #

Semigroup CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Monoid CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

NFData CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CoverageReport -> () Source #

FromJSON CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser CoverageReport

parseJSONList :: Value -> Parser [CoverageReport]

ToJSON CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

toJSON :: CoverageReport -> Value

toEncoding :: CoverageReport -> Encoding

toJSONList :: [CoverageReport] -> Value

toEncodingList :: [CoverageReport] -> Encoding

Pretty CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

pretty :: CoverageReport -> Doc ann

prettyList :: [CoverageReport] -> Doc ann

type Rep CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CoverageReport = D1 ('MetaData "CoverageReport" "PlutusTx.Coverage" "plutus-tx-1.0.0.0-CTJpb0OSKTj2IwExKen56o" 'False) (C1 ('MetaCons "CoverageReport" 'PrefixI 'True) (S1 ('MetaSel ('Just "_coverageIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CoverageIndex) :*: S1 ('MetaSel ('Just "_coverageData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CoverageData)))

data CovLoc Source #

A source location for coverage

Instances

Instances details
Eq CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Read CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Show CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Generic CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CovLoc :: Type -> Type Source #

NFData CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CovLoc -> () Source #

Serialise CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CovLoc -> Encoding

decode :: Decoder s CovLoc

encodeList :: [CovLoc] -> Encoding

decodeList :: Decoder s [CovLoc]

Flat CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CovLoc -> Encoding

decode :: Get CovLoc

size :: CovLoc -> NumBits -> NumBits

FromJSON CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser CovLoc

parseJSONList :: Value -> Parser [CovLoc]

ToJSON CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

toJSON :: CovLoc -> Value

toEncoding :: CovLoc -> Encoding

toJSONList :: [CovLoc] -> Value

toEncodingList :: [CovLoc] -> Encoding

Pretty CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

pretty :: CovLoc -> Doc ann

prettyList :: [CovLoc] -> Doc ann

type Rep CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CovLoc = D1 ('MetaData "CovLoc" "PlutusTx.Coverage" "plutus-tx-1.0.0.0-CTJpb0OSKTj2IwExKen56o" 'False) (C1 ('MetaCons "CovLoc" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_covLocFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "_covLocStartLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "_covLocEndLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just "_covLocStartCol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "_covLocEndCol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))))

addCoverageMetadata :: CoverageAnnotation -> Metadata -> CoverageIndex -> CoverageIndex Source #

Add metadata to a coverage annotation. Does nothing if the annotation is not in the index.

addLocationToCoverageIndex :: MonadWriter CoverageIndex m => CovLoc -> m CoverageAnnotation Source #

Include a location coverage annotation in the index

addBoolCaseToCoverageIndex :: MonadWriter CoverageIndex m => CovLoc -> Bool -> CoverageMetadata -> m CoverageAnnotation Source #

Include a boolean coverage annotation in the index