summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2026-06-27 19:11:54 +0100
committerjao <jao@gnu.org>2026-06-27 19:11:54 +0100
commit7188da69157d0d71dbfe1d7e4315a609dbecbb81 (patch)
treed12650c8519891bbd2b0dd93a5b7f6226b57541f
parentde4f90a255e6b5f0034f7c380a034a695b77ea70 (diff)
downloadxmobar-7188da69157d0d71dbfe1d7e4315a609dbecbb81.tar.gz
xmobar-7188da69157d0d71dbfe1d7e4315a609dbecbb81.tar.bz2
unit test improvements
-rw-r--r--test/Xmobar/Plugins/Monitors/CpuSpec.hs4
1 files changed, 2 insertions, 2 deletions
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: <total>%"]
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: <total>% <bar>"]
cpuArgs <- getArguments args
@@ -40,4 +40,4 @@ spec =
do let args = ["-L","3","-H","50","--normal","green","--high","red", "-t", "Cpu: <user> <nice> <iowait>"]
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]?")