From 57516242357cba015cc5e99e28d7f5e87dc5d7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 30 Nov 2024 19:31:49 +0100 Subject: Trace regex variables in expect using new type --- src/Run.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Run.hs') diff --git a/src/Run.hs b/src/Run.hs index 54fdba6..f6eba39 100644 --- a/src/Run.hs +++ b/src/Run.hs @@ -273,9 +273,8 @@ exprFailed desc sline pname exprVars = do ] throwError Failed -expect :: SourceLine -> Process -> Expr Regex -> [TypedVarName Text] -> TestRun () -> TestRun () -expect sline p expr tvars inner = do - re <- eval expr +expect :: SourceLine -> Process -> Traced Regex -> [TypedVarName Text] -> TestRun () -> TestRun () +expect sline p (Traced trace re) tvars inner = do timeout <- asks $ optTimeout . teOptions . fst delay <- liftIO $ registerDelay $ ceiling $ 1000000 * timeout mbmatch <- atomicallyTest $ (Nothing <$ (check =<< readTVar delay)) <|> do @@ -302,7 +301,7 @@ expect sline p expr tvars inner = do outProc OutputMatch p line local (fmap $ \s -> s { tsVars = zip vars (map someConstValue capture) ++ tsVars s }) inner - Nothing -> exprFailed (T.pack "expect") sline (Just $ procName p) =<< gatherVars expr + Nothing -> exprFailed (T.pack "expect") sline (Just $ procName p) trace flush :: Process -> Maybe Regex -> TestRun () flush p mbre = do -- cgit v1.2.3