From 7188da69157d0d71dbfe1d7e4315a609dbecbb81 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 27 Jun 2026 19:11:54 +0100 Subject: unit test improvements --- test/Xmobar/Plugins/Monitors/CpuSpec.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/Xmobar/Plugins/Monitors/CpuSpec.hs b/test/Xmobar/Plugins/Monitors/CpuSpec.hs index c8d7867..f7e7f97 100644 --- a/test/Xmobar/Plugins/Monitors/CpuSpec.hs +++ b/test/Xmobar/Plugins/Monitors/CpuSpec.hs @@ -20,7 +20,7 @@ spec = do let args = ["-L","3","-H","50","--normal","green","--high","red", "-t", "Cpu: %"] cpuArgs <- getArguments args cpuValue <- runCpu cpuArgs - cpuValue `shouldSatisfy` (\item -> "Cpu:" `isPrefixOf` item) + cpuValue `shouldSatisfy` (=~ "Cpu: [0-9]+%") it "works with bar template" $ do let args = ["-L","3","-H","50","--normal","green","--high","red", "-t", "Cpu: % "] cpuArgs <- getArguments args @@ -40,4 +40,4 @@ spec = do let args = ["-L","3","-H","50","--normal","green","--high","red", "-t", "Cpu: "] cpuArgs <- getArguments args cpuValue <- runCpu cpuArgs - cpuValue `shouldSatisfy` (\item -> "Cpu:" `isPrefixOf` cpuValue) + cpuValue `shouldSatisfy` (=~ "Cpu: [0-9][0-9]? [0-9][0-9]? [0-9][0-9]?") -- cgit v1.2.3