mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TDB2: Made sure file exists before checking readability
This commit is contained in:
parent
764ada3a17
commit
80ea2bb51d
2 changed files with 4 additions and 2 deletions
|
@ -571,8 +571,8 @@ const std::string TF2::dump ()
|
|||
label = rightJustify (_file._data.substr (slash + 1), 14);
|
||||
|
||||
// File mode.
|
||||
std::string mode = std::string (_file.readable () ? "r" : "-") +
|
||||
std::string (_file.writable () ? "w" : "-");
|
||||
std::string mode = std::string (_file.exists () && _file.readable () ? "r" : "-") +
|
||||
std::string (_file.exists () && _file.writable () ? "w" : "-");
|
||||
if (mode == "r-") mode = red.colorize (mode);
|
||||
else if (mode == "rw") mode = green.colorize (mode);
|
||||
else mode = yellow.colorize (mode);
|
||||
|
|
|
@ -50,6 +50,8 @@ class TestDiagnostics(TestCase):
|
|||
self.tap(out)
|
||||
self.assertRegexpMatches(out, "Compliance:\s+C\+\+11")
|
||||
self.assertRegexpMatches(out, "libgnutls:\s+\d+\.\d+\.\d+")
|
||||
self.assertIn("edlin", out)
|
||||
self.assertIn("strict", out)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue