mirror of
git://git.gnupg.org/gnupg.git
synced 2025-05-24 16:43:28 +02:00
gpgscm: Move 'trace' and 'stringify'.
* tests/gpgscm/tests.scm (trace, stringify): Move... * tests/gpgscm/lib.scm: ... here. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
245860ecaf
commit
f03d6897be
@ -29,6 +29,18 @@
|
|||||||
(assert #t)
|
(assert #t)
|
||||||
(assert (not #f))
|
(assert (not #f))
|
||||||
|
|
||||||
|
;; Trace displays and returns the given value. A debugging aid.
|
||||||
|
(define (trace x)
|
||||||
|
(display x)
|
||||||
|
(newline)
|
||||||
|
x)
|
||||||
|
|
||||||
|
;; Stringification.
|
||||||
|
(define (stringify expression)
|
||||||
|
(let ((p (open-output-string)))
|
||||||
|
(write expression p)
|
||||||
|
(get-output-string p)))
|
||||||
|
|
||||||
(define (filter pred lst)
|
(define (filter pred lst)
|
||||||
(cond ((null? lst) '())
|
(cond ((null? lst) '())
|
||||||
((pred (car lst))
|
((pred (car lst))
|
||||||
|
@ -17,18 +17,6 @@
|
|||||||
;; You should have received a copy of the GNU General Public License
|
;; You should have received a copy of the GNU General Public License
|
||||||
;; along with this program; if not, see <http://www.gnu.org/licenses/>.
|
;; along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
;; Trace displays and returns the given value. A debugging aid.
|
|
||||||
(define (trace x)
|
|
||||||
(display x)
|
|
||||||
(newline)
|
|
||||||
x)
|
|
||||||
|
|
||||||
;; Stringification.
|
|
||||||
(define (stringify expression)
|
|
||||||
(let ((p (open-output-string)))
|
|
||||||
(write expression p)
|
|
||||||
(get-output-string p)))
|
|
||||||
|
|
||||||
;; Reporting.
|
;; Reporting.
|
||||||
(define (echo . msg)
|
(define (echo . msg)
|
||||||
(for-each (lambda (x) (display x) (display " ")) msg)
|
(for-each (lambda (x) (display x) (display " ")) msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user