You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 20, 2026. It is now read-only.
Hi, I was surprised that s in defaultGolden s is the actual filename. I expected it to add hspec's Env. Here is the motivating example and hacky workaround:
-- hspec-core definitions:-- newtype SpecM a r = SpecM { unSpecM :: WriterT (Endo Config, [SpecTree a]) (ReaderT Env IO) r }-- newtype Env = Env {-- -- | The path of _parent_ `Hspec.Core.Spec.describe` labels from innermost to-- -- outermost.-- envSpecDescriptionPath :: [String]-- }
gold s v =do
env <-SpecM (lift ask)
it s $ defaultGolden (intercalate "." (unsafeCoerce env) ++"."++ s) (pretty 1000$ ppr v)
gold s v = it s $ defaultGolden s (pretty 1000 (ppr v)) -- this version leads to the second set of tests failing on the first runspec::Spec
spec =do
describe "array[10]"dolet fn = [cunit| void f() { while (true) { static int array[10]; } } |]
spec = buildStateSpec fn
gold "language-c-quote AST" fn
gold "structdef"$ buildStateMembers (fields spec)
describe "array[10][7]"dolet fn = [cunit| void f() { while (true) { static int array[10][7]; } } |]
spec = buildStateSpec fn
gold "language-c-quote AST" fn
gold "structdef"$ buildStateMembers (fields spec)
Hi, I was surprised that
sindefaultGolden sis the actual filename. I expected it to add hspec's Env. Here is the motivating example and hacky workaround: