Bug796829 - Report HTML - HTML table rows are prepended not as list elements

includes update of test-report-html.scm (and CMakeLists.txt)
This commit is contained in:
Carsten Rinke 2018-09-03 08:26:17 +02:00 committed by Geert Janssens
parent 59c78c2668
commit 412d797eae
2 changed files with 8 additions and 6 deletions

View File

@ -364,8 +364,9 @@
(define (gnc:html-table-prepend-row! table newrow) (define (gnc:html-table-prepend-row! table newrow)
(let* ((dd (gnc:html-table-data table)) (let* ((dd (gnc:html-table-data table))
(current-num-rows (gnc:html-table-num-rows table)) (current-num-rows (gnc:html-table-num-rows table))
(new-num-rows (+ current-num-rows 1))) (new-num-rows (+ current-num-rows 1))
(set! dd (append dd (list newrow))) (newrow-list (if (list? newrow) newrow (list newrow))))
(set! dd (append dd (list newrow-list)))
(gnc:html-table-set-num-rows-internal! (gnc:html-table-set-num-rows-internal!
table table
new-num-rows) new-num-rows)

View File

@ -686,13 +686,14 @@ HTML Document Title</title></head><body></body>\n\
(gnc:html-table-prepend-row! test-table "Row 1") (gnc:html-table-prepend-row! test-table "Row 1")
(gnc:html-table-prepend-row! test-table "Row 0") (gnc:html-table-prepend-row! test-table "Row 0")
(gnc:html-table-prepend-row! test-table "Row -1") (gnc:html-table-prepend-row! test-table "Row -1")
(gnc:html-table-prepend-row! test-table '("r-2-c1" "r-2-c2"))
(test-equal "Check Num Rows after prepend row" (test-equal "Check Num Rows after prepend row"
4 5
(gnc:html-table-num-rows test-table) (gnc:html-table-num-rows test-table)
) )
(test-expect-fail 1) (test-equal "Check data after prepend row"
(test-equal "Check data after prepend row - Bug 796829"
'(("Row 2") ("Row 1") ("Row 0") ("Row -1")) '(("Row 2") ("Row 1") ("Row 0") ("Row -1") ("r-2-c1" "r-2-c2"))
(gnc:html-table-data test-table) (gnc:html-table-data test-table)
) )
) )