fix most tests

This commit is contained in:
spaced4ndy
2025-07-17 20:57:24 +04:00
parent 4634dbad60
commit cf4f78cd94
3 changed files with 9 additions and 7 deletions
+2 -2
View File
@@ -433,8 +433,8 @@ getTermLine cc@TestCC {printOutput} =
5000000 `timeout` atomically (readTQueue $ termQ cc) >>= \case
Just s -> do
-- remove condition to always echo virtual terminal
-- when True $ do
when printOutput $ do
when True $ do
-- when printOutput $ do
name <- userName cc
putStrLn $ name <> ": " <> s
pure s
+4 -4
View File
@@ -345,11 +345,11 @@ testGroupShared alice bob cath checkMessages = do
-- test clearing chat
threadDelay 1000000
alice #$> ("/clear #team", id, "#team: all messages are removed locally ONLY")
alice #$> ("/_get chat #1 count=100", chat, [])
alice #$> ("/_get chat #1 count=100", chat, [(1,"chat banner")])
bob #$> ("/clear #team", id, "#team: all messages are removed locally ONLY")
bob #$> ("/_get chat #1 count=100", chat, [])
bob #$> ("/_get chat #1 count=100", chat, [(1,"chat banner")])
cath #$> ("/clear #team", id, "#team: all messages are removed locally ONLY")
cath #$> ("/_get chat #1 count=100", chat, [])
cath #$> ("/_get chat #1 count=100", chat, [(1,"chat banner")])
where
getReadChats :: HasCallStack => String -> String -> IO ()
getReadChats msgItem1 msgItem2 = do
@@ -588,7 +588,7 @@ testGroup2 =
]
dan <##> alice
-- show last messages
alice ##> "/t #club 19"
alice ##> "/t #club 20"
alice -- these strings are expected in any order because of sorting by time and rounding of time for sent
<##?
( map (ConsoleString . ("#club " <> )) groupFeatureStrs
+3 -1
View File
@@ -309,7 +309,7 @@ groupFeatureStrs :: [String]
groupFeatureStrs = map (\(a, _, _) -> snd a) $ groupFeatures'' 0
groupFeatures'' :: Int -> [((Int, String), Maybe (Int, String), Maybe String)]
groupFeatures'' dir = ((dir, e2eeInfoNoPQStr), Nothing, Nothing) : groupFeatures_ dir
groupFeatures'' dir = ((1, "chat banner"), Nothing, Nothing) : ((dir, e2eeInfoNoPQStr), Nothing, Nothing) : groupFeatures_ dir
groupFeatures_ :: Int -> [((Int, String), Maybe (Int, String), Maybe String)]
groupFeatures_ dir =
@@ -505,6 +505,8 @@ dropTime_ :: String -> Maybe String
dropTime_ msg = case splitAt 6 msg of
([m, m', ':', s, s', ' '], text) ->
if all isDigit [m, m', s, s'] then Just text else Nothing
([month, month', '-', d, d', ' '], text) ->
if all isDigit [month, month', d, d'] then Just text else Nothing
_ -> Nothing
dropStrPrefix :: HasCallStack => String -> String -> String