[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9cc4196 3/5: Test construction from string (k
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9cc4196 3/5: Test construction from string (keyword) vector |
Date: |
Tue, 7 Feb 2017 04:40:18 +0000 (UTC) |
branch: master
commit 9cc419604fc543001cdd02ccac61b9436e34f09e
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Test construction from string (keyword) vector
---
input_seq_test.cpp | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/input_seq_test.cpp b/input_seq_test.cpp
index f399a18..a7b2b32 100644
--- a/input_seq_test.cpp
+++ b/input_seq_test.cpp
@@ -324,7 +324,7 @@ int test_main(int, char*[])
// TODO ?? Test against canonical representation once we define that.
- // Test construction from vector.
+ // Test construction from numeric vector.
{
int const n = 5;
double const d[n] = {1, 1, 1, 2, 2};
@@ -336,6 +336,16 @@ int test_main(int, char*[])
);
}
+ // Test construction from string (keyword) vector.
+ {
+ std::vector<std::string> const v{"alpha", "beta", "beta", "gamma", "eta"};
+ BOOST_TEST(v == InputSequence(v).linear_keyword_representation());
+ BOOST_TEST_EQUAL
+ ("alpha [0, 1); beta [1, 3); gamma [3, 4); eta [4, maturity)"
+ ,InputSequence(v).mathematical_representation()
+ );
+ }
+
// Test construction from one-element vector.
{
int const n = 1;