lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 4d5025d 1/3: Use terser syntax in unit test


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 4d5025d 1/3: Use terser syntax in unit test
Date: Wed, 15 Aug 2018 18:16:12 -0400 (EDT)

branch: master
commit 4d5025d296ca883feab4eb23d02964cc592e9727
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Use terser syntax in unit test
    
    Even denser would be
    -    std::vector<int> const expected = {3, 4, 5};
    -    BOOST_TEST(widths(v) == expected);
    +    BOOST_TEST(widths(v) == std::vector<int>({3, 4, 5}));
    but writing the parentheses that the preprocessor then requires is
    too high a price to pay.
---
 report_table_test.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/report_table_test.cpp b/report_table_test.cpp
index 2e98235..5b2b20c 100644
--- a/report_table_test.cpp
+++ b/report_table_test.cpp
@@ -130,9 +130,8 @@ void report_table_test::test_generally()
 {
     std::vector<table_column_info> v = bloat({1, 2, 3}, {0, 0, 0});
     set_column_widths(13, 1, v);
-    std::vector<int> const observed = widths(v);
     std::vector<int> const expected = {3, 4, 5};
-    BOOST_TEST(observed == expected);
+    BOOST_TEST(widths(v) == expected);
 }
 
 /// Test data for an actual group quote.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]