diff options
| author | jao <jao@gnu.org> | 2026-06-27 19:11:54 +0100 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-06-27 19:11:54 +0100 |
| commit | 7188da69157d0d71dbfe1d7e4315a609dbecbb81 (patch) | |
| tree | d12650c8519891bbd2b0dd93a5b7f6226b57541f /test/Xmobar | |
| parent | de4f90a255e6b5f0034f7c380a034a695b77ea70 (diff) | |
| download | xmobar-7188da69157d0d71dbfe1d7e4315a609dbecbb81.tar.gz xmobar-7188da69157d0d71dbfe1d7e4315a609dbecbb81.tar.bz2 | |
unit test improvements
Diffstat (limited to 'test/Xmobar')
| -rw-r--r-- | test/Xmobar/Plugins/Monitors/CpuSpec.hs | 4 |
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]?") |
