mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[test-collectors] cease testing collectors.scm
This commit is contained in:
parent
f5f24eb9ca
commit
c13085f361
@ -11,7 +11,6 @@ gnc_add_test_with_guile(test-link-module-report-system test-link-module.c
|
||||
|
||||
set(scm_test_report_system_SOURCES
|
||||
test-load-report-system-module.scm
|
||||
test-collectors.scm
|
||||
test-test-extras.scm
|
||||
)
|
||||
|
||||
|
@ -25,64 +25,6 @@
|
||||
(use-modules (sxml simple))
|
||||
(use-modules (sxml xpath))
|
||||
|
||||
(export pattern-streamer)
|
||||
|
||||
(export tbl-column-count)
|
||||
(export tbl-row-count)
|
||||
(export tbl-ref)
|
||||
(export tbl-ref->number)
|
||||
|
||||
;;
|
||||
;; Table parsing
|
||||
;;
|
||||
(use-modules (ice-9 regex))
|
||||
(use-modules (ice-9 streams))
|
||||
|
||||
(define (values-for-keywords pos regex-list text)
|
||||
(make-stream (lambda (pos-keywords-pair)
|
||||
(let ((current-pos (car pos-keywords-pair))
|
||||
(regex-list (cdr pos-keywords-pair)))
|
||||
(if (null? regex-list)
|
||||
'()
|
||||
(let ((match (string-match (caar regex-list) text current-pos)))
|
||||
(if (not match)
|
||||
'()
|
||||
(let ((new-state (cons (match:end match)
|
||||
(cdr regex-list)))
|
||||
(next-value (cons (match:end match)
|
||||
(map (lambda (item)
|
||||
(match:substring match item))
|
||||
(cdar regex-list)))))
|
||||
(cons next-value new-state)))))))
|
||||
(cons pos regex-list)))
|
||||
|
||||
(define (pattern-streamer start-text regex-list text)
|
||||
(define (stream-next index)
|
||||
;;(format #t "Next. Index: ~a\n" index)
|
||||
(let ((head-index (string-contains text start-text index)))
|
||||
;; (format #t "head index ~a ~a --> ~a\n" start-text index head-index)
|
||||
(if (not head-index) '()
|
||||
(let ((values (stream->list (values-for-keywords head-index regex-list text))))
|
||||
(if (null? values) '()
|
||||
(let ((new-state (car (car (last-pair values))))
|
||||
(next-value (map cdr values)))
|
||||
(cons next-value new-state)))))))
|
||||
;;(format #t "Stream ~a\n" text)
|
||||
(make-stream stream-next 0))
|
||||
|
||||
;; silly table functions
|
||||
(define (tbl-column-count tbl)
|
||||
(length (car tbl)))
|
||||
|
||||
(define (tbl-row-count tbl)
|
||||
(length tbl))
|
||||
|
||||
(define (tbl-ref tbl row-index column-index)
|
||||
(list-ref (list-ref tbl row-index) column-index))
|
||||
|
||||
(define (tbl-ref->number tbl row-index column-index)
|
||||
(string->number (car (tbl-ref tbl row-index column-index))))
|
||||
|
||||
(export gnc:options->render)
|
||||
(define (gnc:options->render uuid options prefix test-title)
|
||||
;; uuid - str to locate report uuid
|
||||
|
Loading…
Reference in New Issue
Block a user