[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master c6eab5e 1/4: Augment unit tests
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master c6eab5e 1/4: Augment unit tests |
Date: |
Tue, 14 Feb 2017 18:31:42 -0500 (EST) |
branch: master
commit c6eab5e82b3251b4ea0a0379616ac943fa164925
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Augment unit tests
---
input_sequence_test.cpp | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/input_sequence_test.cpp b/input_sequence_test.cpp
index 624069e..127bd71 100644
--- a/input_sequence_test.cpp
+++ b/input_sequence_test.cpp
@@ -467,6 +467,32 @@ int test_main(int, char*[])
);
}
+ // Test an expression with a gap before the first interval,
+ // with the keywords-only switch (and a default keyword).
+ {
+ int const n = 5;
+ strvec const c {"z", "q", "q", "p", "p"};
+ double const d[n] = { 0 , 0 , 0 , 0 , 0 };
+ std::string const e("q [1, 3); p [3, maturity)");
+ strvec const k{"p", "q", "z"};
+ bool const o = true;
+ std::string w("z");
+ check(__FILE__, __LINE__, n, d, e, "", k, c, o, w);
+ }
+
+ // Test an expression with a gap before the first interval,
+ // without the keywords-only switch. The default value should
+ // be numeric, and the keyword gap should be filled with an
+ // empty string.
+ {
+ int const n = 5;
+ strvec const c {"", "q", "q", "p", "p"};
+ double const d[n] = { 0 , 0 , 0 , 0 , 0 };
+ std::string const e("q [1, 3); p [3, maturity)");
+ strvec const k{"p", "q", "z"};
+ check(__FILE__, __LINE__, n, d, e, "", k, c);
+ }
+
// Duration keywords: {retirement, maturity}
{
int const n = 10;