feat: support sway+swaylock for screen saver lock check#372
Conversation
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
zupo
left a comment
There was a problem hiding this comment.
That looks like it was a major PITA to figure out how to test, good job.
ca79447 to
d322d68
Compare
| if _, err := lookPath("sway"); err == nil { | ||
| f.passed = f.checkSway() |
There was a problem hiding this comment.
Logic bug: The function unconditionally overwrites f.passed with the result of f.checkSway(), ignoring previous successful checks from GNOME or KDE. This means if GNOME passes but Sway fails (or vice versa), the final result will only reflect the Sway check. The logic should use OR (||) to preserve any previous successful results: f.passed = f.passed || f.checkSway() or use an early return pattern when a check passes.
| if _, err := lookPath("sway"); err == nil { | |
| f.passed = f.checkSway() | |
| if _, err := lookPath("sway"); err == nil { | |
| f.passed = f.passed || f.checkSway() |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
b3412ce to
86f6586
Compare
39ae389 to
634a00a
Compare
634a00a to
978fbb8
Compare
Ref: #129