diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-07-25 21:05:04 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-07-25 21:06:16 +0200 |
commit | 32326a87d0bef92e21451ba45a5bcb06a8a28568 (patch) | |
tree | 296a2d57b028bbb8daa65bca584b5db7aa44e156 | |
parent | aa1b5c547329036bc9a5fa54d8f609c435da6389 (diff) |
Test: print output using bytestring calls
-rw-r--r-- | main/Test.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/Test.hs b/main/Test.hs index 97eaee7..6e10b54 100644 --- a/main/Test.hs +++ b/main/Test.hs @@ -97,7 +97,7 @@ runTestTool st = do Nothing -> return () runExceptT (evalStateT testLoop initTestState) >>= \case - Left x -> hPutStrLn stderr x + Left x -> B.hPutStr stderr $ (`BC.snoc` '\n') $ BC.pack x Right () -> return () getLineMb :: MonadIO m => m (Maybe Text) @@ -121,7 +121,7 @@ outLine :: Output -> String -> IO () outLine mvar line = do evaluate $ foldl' (flip seq) () line withMVar mvar $ \() -> do - putStrLn line + B.putStr $ (`BC.snoc` '\n') $ BC.pack line hFlush stdout cmdOut :: String -> Command @@ -428,7 +428,7 @@ cmdStartServer = do h <- getOrLoadHead rsPeers <- liftIO $ newMVar (1, []) - rsServer <- liftIO $ startServer defaultServerOptions h (hPutStrLn stderr) + rsServer <- liftIO $ startServer defaultServerOptions h (B.hPutStr stderr . (`BC.snoc` '\n') . BC.pack) [ someServiceAttr $ pairingAttributes (Proxy @AttachService) out rsPeers "attach" , someServiceAttr $ pairingAttributes (Proxy @ContactService) out rsPeers "contact" , someServiceAttr $ directMessageAttributes out |