Verified Commit 1131ac40 authored by Camil Staps's avatar Camil Staps 🚀

Put back hierarchical names (fixes issue introduced in !7)

parent bdc5b9d6
......@@ -198,7 +198,7 @@ label :: !l !p -> Property | Testable p & genShow{|*|} l
label l p = Prop (testname p) (\rs r = evaluate p rs {r & labels = [show1 l:r.labels]})
name :: !n !p -> Property | Testable p & toString n
name n p = Prop (toString n) (evaluate p)
name n p = Prop (toString n) (\rs r -> evaluate p rs {r & namePath=[toString n:r.namePath]})
limitNrOfRecFieldValues :: !(Map (TypeName, RecFieldName) Int) !p -> Property | Testable p
limitNrOfRecFieldValues limits p = Prop (testname p) (\rs r = evaluate p rs {Admin| r & recFieldValueNrLimits = limits})
......
......@@ -23,6 +23,7 @@ from Text.JSON import :: JSONNode, generic JSONEncode
{ labels :: ![String]
, args :: ![String]
, argsJSON :: ![JSONNode]
, namePath :: ![String]
, res :: !Result
, failedAssertions :: ![(!FailedAssertion, !String, !String)] //* Failed assertion & string representation of args
, recFieldValueNrLimits :: !Map (TypeName, RecFieldName) Int //* Restricts the number of values generated for record fields
......
......@@ -32,6 +32,7 @@ instance == Result where (==) x y = x===y
newAdmin :: Admin
newAdmin = { res=Undef, labels=[], args=[], argsJSON = [], failedAssertions = []
, namePath = []
, recFieldValueNrLimits = 'Map'.newMap
}
......@@ -432,7 +433,7 @@ where
, nE = nE
, args = res.Admin.args
, argsJSON = res.Admin.argsJSON
, name = testname p
, name = join "." [testname p:reverse res.namePath]
, failedAssertions = res.Admin.failedAssertions
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment