mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
TDB2: Made sure file exists before checking readability
This commit is contained in:
parent
68dac1b6c6
commit
5a97ffee10
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);
|
label = rightJustify (_file._data.substr (slash + 1), 14);
|
||||||
|
|
||||||
// File mode.
|
// File mode.
|
||||||
std::string mode = std::string (_file.readable () ? "r" : "-") +
|
std::string mode = std::string (_file.exists () && _file.readable () ? "r" : "-") +
|
||||||
std::string (_file.writable () ? "w" : "-");
|
std::string (_file.exists () && _file.writable () ? "w" : "-");
|
||||||
if (mode == "r-") mode = red.colorize (mode);
|
if (mode == "r-") mode = red.colorize (mode);
|
||||||
else if (mode == "rw") mode = green.colorize (mode);
|
else if (mode == "rw") mode = green.colorize (mode);
|
||||||
else mode = yellow.colorize (mode);
|
else mode = yellow.colorize (mode);
|
||||||
|
|
|
@ -50,6 +50,8 @@ class TestDiagnostics(TestCase):
|
||||||
self.tap(out)
|
self.tap(out)
|
||||||
self.assertRegexpMatches(out, "Compliance:\s+C\+\+11")
|
self.assertRegexpMatches(out, "Compliance:\s+C\+\+11")
|
||||||
self.assertRegexpMatches(out, "libgnutls:\s+\d+\.\d+\.\d+")
|
self.assertRegexpMatches(out, "libgnutls:\s+\d+\.\d+\.\d+")
|
||||||
|
self.assertIn("edlin", out)
|
||||||
|
self.assertIn("strict", out)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue