[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 08861f2 2/3: Strengthen input-sequence unit t
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 08861f2 2/3: Strengthen input-sequence unit test |
Date: |
Fri, 27 Jan 2017 20:53:09 +0000 (UTC) |
branch: master
commit 08861f23dc3fdf22a452499b86e9dd28d0f80118
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Strengthen input-sequence unit test
Formerly, when comparing linear_keyword_representation() against
its expected value, the test verified only that either
- the default was expected (regardless of the actual result), or
- a nondefault expectation matched the actual result.
The test now validates whether actual equals expected.
---
input_seq_test.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/input_seq_test.cpp b/input_seq_test.cpp
index 192c69b..1591d42 100644
--- a/input_seq_test.cpp
+++ b/input_seq_test.cpp
@@ -55,7 +55,12 @@ void check
}
std::vector<std::string> s(seq.linear_keyword_representation());
- bool const bs = nullptr == c || s == std::vector<std::string>(c, c + n);
+ std::vector<std::string> expected_keyword_representation =
+ (nullptr == c)
+ ? std::vector<std::string>(n)
+ : std::vector<std::string>(c, c + n)
+ ;
+ bool const bs = s == expected_keyword_representation;
if(!bs)
{
std::cout << "\nExpression: '" << e << '\'';