[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 98295b5 2/4: Fix defects demonstrated in the
[lmi-commits] [lmi] master 98295b5 2/4: Fix defects demonstrated in the immediately preceding commit
Thu, 2 Feb 2017 02:13:13 +0000 (UTC)
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Fix defects demonstrated in the immediately preceding commit
Formerly, when comparing formatted_diagnostics() against its expected
value, the test verified only that either
- actual matched expected, or
- actual was empty (even if expected was not).
The test now validates whether actual equals expected.
This is uncomfortably similar to the 2017-01-27T20:30:54 commit.
Unfortunately, this change destroys the austere simplicity of variable
names, which must be restored posthaste; then the temporary tests added
in the immediately preceding commit (which now correctly fail) can be
input_seq_test.cpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/input_seq_test.cpp b/input_seq_test.cpp
index 7562846..84545e1 100644
@@ -74,15 +74,16 @@ void check
std::cout << std::endl;
- std::string const& y = seq.formatted_diagnostics();
- bool const by = y.empty() || y == std::string(x);
+ std::string const& y0(seq.formatted_diagnostics());
+ std::string const y1 = (nullptr == x) ? std::string() : std::string(x);
+ bool const by = y0 == y1;
<< "\nObserved diagnostics:"
- << "\n\n'" << y << "'"
+ << "\n\n'" << y0 << "'"
<< "\n\ndiffer from expected:"
- << "\n\n'" << x << "'"
+ << "\n\n'" << y1 << "'"