[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 0cfdd92 4/4: Refine a unit test
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 0cfdd92 4/4: Refine a unit test |
Date: |
Tue, 14 Feb 2017 18:31:43 -0500 (EST) |
branch: master
commit 0cfdd92527b3faa837331426867ba164549380d8
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Refine a unit test
Made values unique for each interval in the overlapping-intervals test,
to clarify which part of the canonical representation corresponds to
which interval in the original expression.
Also canonicalized the string more carefully, because it's not obvious
that overlapping intervals can simply be forbidden.
---
input_sequence_test.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/input_sequence_test.cpp b/input_sequence_test.cpp
index a26e840..5a21fdc 100644
--- a/input_sequence_test.cpp
+++ b/input_sequence_test.cpp
@@ -310,10 +310,11 @@ int test_main(int, char*[])
// Test overlapping intervals.
{
int const n = 9;
- double const d[n] = {1, 1, 1, 3, 3, 5, 5, 7, 7};
- std::string const e("1; 1 (0, 8]; 3 (2, 7]; 5 (4, 6]; 7");
+ double const d[n] = {0, 1, 1, 3, 3, 5, 5, 7, 7};
+ std::string const e("0; 1 (0, 8]; 3 (2, 7]; 5 (4, 6]; 7");
// mathematical_representation() returns '...1 [1, maturity)3 [3, 8)...'?
- std::string const g("1 [0, 1); 1 (0, 8]; 3 (2, 7]; 5 (4, 6]; 7"); // Isn't
this invalid?
+ // Should overlapping intervals be accepted anyway?
+ std::string const g("0 [0, 1); 1 [1, 9); 3 [3, 8); 5 [5, 7); 7 [7,
maturity)");
check(__FILE__, __LINE__, n, d, e, g);
}