[GNC-dev] Patch for 3.4 failing for 3.4-39 and after

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[GNC-dev] Patch for 3.4 failing for 3.4-39 and after

Stephen M. Butler
Got a message about a fuzzy patch that needed to be fixed.

Lines 655-656 of test-transaction.scm now have:

          (list "$103 income" "Root.Asset.Bank" "$103.00" "$103.00")
          (cdr (get-row-col sxml 1 #f))))

The patch is expecting:

           (list "01/03/18" "$103 income" "Root.Asset.Bank" "$103.00"
           (get-row-col sxml 1 #f)))

So what changes do I need to make to this patch so it will allow test
109 to pass?  Or is it time to remove it?


Origin: upstream, https://bugs.gnucash.org/attachment.cgi?id=373094
Bug-Upstream: https://bugs.gnucash.org/show_bug.cgi?id=797008
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918057
From: Maxim Cournoyer <[hidden email]>
Date: Wed, 2 Jan 2019 14:46:28 -0500
Subject: tests: Fix a test failure in test-transaction.scm.

With the New Year upon us, a test which was hard-coded to use 2018 now

Fixes issue #797008 (see:

* gnucash/report/standard-reports/test/test-transaction.scm:
(trep-tests): Use the current year in the test string instead of a
static one.

--- a/gnucash/report/standard-reports/test/test-transaction.scm
+++ b/gnucash/report/standard-reports/test/test-transaction.scm
@@ -4,8 +4,9 @@
 (use-modules (gnucash report standard-reports transaction))
 (use-modules (gnucash report stylesheets))
 (use-modules (gnucash report report-system))
 (use-modules (gnucash report report-system test test-extras))
+(use-modules (srfi srfi-19))
 (use-modules (srfi srfi-64))
 (use-modules (gnucash engine test srfi64-extras))
 (use-modules (sxml simple))
 (use-modules (sxml xpath))
@@ -642,18 +643,20 @@
       (set-option! options "General" "Common Currency" #t)
       (set-option! options "General" "Show original currency amount" #t)
       (set-option! options "Sorting" "Primary Key" 'date)
       (set-option! options "Sorting" "Primary Subtotal for Date Key" 'none)
-      (let* ((sxml (options->sxml options "dual columns")))
+      (let* ((sxml (options->sxml options "dual columns"))
+         (current-year (date->string (current-date) "~y")))
         (test-equal "dual amount column, with original currency headers"
           (list "Date" "Num" "Description" "Memo/Notes" "Account"
                 "Debit (USD)" "Credit (USD)" "Debit" "Credit")
           (get-row-col sxml 0 #f))
         (test-equal "dual amount column, grand totals available"
           (list "Grand Total" "$2,280.00" "$2,280.00")
           (get-row-col sxml -1 #f))
         (test-equal "dual amount column, first transaction correct"
-          (list "01/03/18" "$103 income" "Root.Asset.Bank" "$103.00"
+          (list (string-append "01/03/" current-year) "$103 income"
+        "Root.Asset.Bank" "$103.00" "$103.00")
           (get-row-col sxml 1 #f)))
     (test-end "display options")

gnucash-devel mailing list
[hidden email]