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:
Justus Winter 2017-04-19 16:09:44 +02:00
parent 245860ecaf
commit f03d6897be
No known key found for this signature in database
GPG Key ID: DD1A52F9DA8C9020
2 changed files with 12 additions and 12 deletions

View File

@ -29,6 +29,18 @@
(assert #t)
(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)
(cond ((null? lst) '())
((pred (car lst))

View File

@ -17,18 +17,6 @@
;; You should have received a copy of the GNU General Public License
;; 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.
(define (echo . msg)
(for-each (lambda (x) (display x) (display " ")) msg)