tasty-sugar-1.2.0.0: Tests defined by Search Using Golden Answer References
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Tasty.Sugar.ParamCheck

Description

Functions for checking different parameter/value combinations.

Synopsis

Documentation

eachFrom :: [a] -> Logic a Source #

Core Logic function to iteratively return elements of a list via backtracking.

getPVals :: [ParameterPattern] -> Logic [(String, Maybe String)] Source #

Returns various combinations of parameter value selections

pvalMatch :: Separators -> [NamedParamMatch] -> [(String, Maybe String)] -> Logic ([NamedParamMatch], Int, String) Source #

Generate each possible combination of Explicit or non-Explicit (Assumed or NotSpecified) parameter value and the corresponding string with each combination of separators. The string will be used to match against input files.

Note that valid combinations require that if a parameter is non-Explicit, all following parameters must also be non-Explicit.

The preset set of parameters are any parameters *already* matched against (usually in the rootName); these parameters may or may not be present in the filename matched from the output of this function, but if they are present, they must have the values specified in the preset (instead of having any of the possible values allowed for that parameter).

It's also possible that since this returns varying combinations of parameters, that there may be multiple files that will match against these combinations. Therefore, the results also indicate how many of the parameters are used in the associated matching string since the caller will usually select the match with the highest ranking (number of matched parameters) in the filename. [Note that it is not possibly to simply use the length of the [NamedParamMatch] return component since that may contain values from the preset that don't actually occur in the match string.