lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master dd3efb8: Make CLI and CGI tests more stringen


From: Greg Chicares
Subject: [lmi-commits] [lmi] master dd3efb8: Make CLI and CGI tests more stringent
Date: Tue, 8 Aug 2017 16:32:15 -0400 (EDT)

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

    Make CLI and CGI tests more stringent
    
    Error counts were misleading because output files did not end in a
    newline. Instructing 'diff' to ignore all whitespace was a sloppy and
    nonportable workaround.
---
 cgi.touchstone          |  3 ++-
 ledger_text_formats.cpp | 16 ++++++++--------
 workhorse.make          |  2 --
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/cgi.touchstone b/cgi.touchstone
index 321d9f3..a208a57 100644
--- a/cgi.touchstone
+++ b/cgi.touchstone
@@ -170,7 +170,8 @@ Page 2 of 3Tabular detail
      53          98        0.00        0.00        0.00        0.00  
5580843.19  5580843.19  5580843.19
      54          99        0.00        0.00        0.00        0.00  
5889539.70  5889539.70  5889539.70
      55         100        0.00        0.00        0.00        0.00  
6215438.61  6215438.61  6215438.61
-Page 3 of 3</small></pre><hr>
+Page 3 of 3
+</small></pre><hr>
 
     Calculations: 12 milliseconds<BR>
     Output:       5 milliseconds<BR>
diff --git a/ledger_text_formats.cpp b/ledger_text_formats.cpp
index ae021e4..fdd4b75 100644
--- a/ledger_text_formats.cpp
+++ b/ledger_text_formats.cpp
@@ -939,6 +939,9 @@ void FlatTextLedgerPrinter::Print() const
     PrintTabularDetail      ();
     PrintFooter             ();
 
+    // 'os_' may be a std::ofstream, and files should end in a newline.
+    os_ << '\n';
+
     LMI_ASSERT(os_.good());
 }
 
@@ -1090,7 +1093,8 @@ void FlatTextLedgerPrinter::PrintNumericalSummary() const
 
     os_ << endrow;
 
-    auto const lapse_year = [age, max_length] (LedgerVariant const& basis)
+    // Illustration reg (7)(C)(2) "year in which coverage ceases".
+    auto const brink = [age, max_length] (LedgerVariant const& basis)
         {
         int const z = basis.LapseYear;
         std::string s =
@@ -1103,13 +1107,9 @@ void FlatTextLedgerPrinter::PrintNumericalSummary() const
         return s;
         };
 
-    os_
-        << "                    "
-        << lapse_year(guar_())
-        << lapse_year(mdpt_())
-        << lapse_year(curr_())
-        << endrow
-        ;
+    std::string s = brink(guar_()) + brink(mdpt_()) + brink(curr_());
+    rtrim(s, " ");
+    os_ << "                    " << s << endrow;
 
     os_ << endrow;
 }
diff --git a/workhorse.make b/workhorse.make
index 6463937..97b4532 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -1175,7 +1175,6 @@ cli_test-%:
          >$*.touchstone
        @<$*.touchstone \
          $(DIFF) \
-             --ignore-all-space \
              --ignore-matching-lines='Prepared on' \
              - $(srcdir)/$*.touchstone \
          | $(WC)   -l \
@@ -1194,7 +1193,6 @@ cgi_tests: $(test_data) configurable_settings.xml 
antediluvian_cgi$(EXEEXT)
        @$(PERFORM) ./antediluvian_cgi$(EXEEXT) --enable_test <cgi.test.in 
>cgi.touchstone
        @<cgi.touchstone \
          $(DIFF) \
-             --ignore-all-space \
              --ignore-matching-lines='Prepared on' \
              --ignore-matching-lines='Compiled at' \
              --ignore-matching-lines=':[ 0-9]*milliseconds' \



reply via email to

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