mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
tests: Add tr:assert-same function.
* tests/gpgscm/tests.scm (tr:assert-same-string): New. * tests/openpgp/shell.scm: Option to drop into a REPL.
This commit is contained in:
parent
bd612f2360
commit
9b24d8ab50
@ -493,6 +493,12 @@
|
|||||||
(fail "mismatch"))
|
(fail "mismatch"))
|
||||||
(list tmpfiles source #f)))
|
(list tmpfiles source #f)))
|
||||||
|
|
||||||
|
(define (tr:assert-same reference)
|
||||||
|
(lambda (tmpfiles source)
|
||||||
|
(if (not (string=? (call-with-input-file source read-all) reference))
|
||||||
|
(fail "mismatch"))
|
||||||
|
(list tmpfiles source #f)))
|
||||||
|
|
||||||
(define (tr:call-with-content function . args)
|
(define (tr:call-with-content function . args)
|
||||||
(lambda (tmpfiles source)
|
(lambda (tmpfiles source)
|
||||||
(catch (list tmpfiles source *error*)
|
(catch (list tmpfiles source *error*)
|
||||||
|
@ -218,8 +218,8 @@ There is one source function, tr:open. To describe a transformation
|
|||||||
using some process, use tr:spawn, tr:gpg, or tr:pipe-do. There are
|
using some process, use tr:spawn, tr:gpg, or tr:pipe-do. There are
|
||||||
several sinks, although sink is not quite the right term, because the
|
several sinks, although sink is not quite the right term, because the
|
||||||
data is not consumed, and hence one can use them at any position. The
|
data is not consumed, and hence one can use them at any position. The
|
||||||
"sinks" are tr:write-to, tr:call-with-content, tr:assert-identity, and
|
"sinks" are tr:write-to, tr:call-with-content, tr:assert-identity,
|
||||||
tr:assert-weak-identity.
|
tr:assert-weak-identity, and tr:assert-same.
|
||||||
|
|
||||||
A somewhat contrived example demonstrating many functions is:
|
A somewhat contrived example demonstrating many functions is:
|
||||||
|
|
||||||
|
@ -47,7 +47,9 @@
|
|||||||
(pathsep-split (getenv "PATH"))))
|
(pathsep-split (getenv "PATH"))))
|
||||||
#t)
|
#t)
|
||||||
|
|
||||||
(echo "\nEnjoy your test environment. "
|
(if (prompt-yes-no? "Run system shell" #t)
|
||||||
|
((echo "\nEnjoy your test environment. "
|
||||||
"Type 'exit' to exit it, it will be cleaned up after you.\n")
|
"Type 'exit' to exit it, it will be cleaned up after you.\n")
|
||||||
|
(interactive-shell))
|
||||||
(interactive-shell)
|
((echo "\nEnjoy the REPL.")
|
||||||
|
(interactive-repl (current-environment))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user