1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

tests: Avoid dependency on util-linux for 'rev'.

* test-suite/tests/popen.test ("open-process", "pipeline"): Use 'tr'
instead of 'rev' to avoid an extra dependency on util-linux.
This commit is contained in:
Ludovic Courtès 2020-06-04 15:38:12 +02:00
parent df22eb5956
commit e7398643b2

View file

@ -221,10 +221,11 @@ exec 2>~a; read REPLY"
;;
(pass-if-equal "open-process"
'("hello world" 0)
'("HELLO WORLD" 0)
(receive (from to pid)
((@@ (ice-9 popen) open-process) OPEN_BOTH "rev")
(display "dlrow olleh" to) (close to)
((@@ (ice-9 popen) open-process) OPEN_BOTH
"tr" "[:lower:]" "[:upper:]")
(display "hello world" to) (close to)
(list (read-string from)
(status:exit-val (cdr (waitpid pid))))))
@ -244,8 +245,9 @@ exec 2>~a; read REPLY"
(status:exit-val (cdr (waitpid pid))))))
(pass-if-equal "pipeline"
'("hello world\n" (0 0))
'("HELLO WORLD\n" (0 0))
(receive (from to pids)
(pipeline '(("echo" "dlrow olleh") ("rev")))
(pipeline '(("echo" "hello world")
("tr" "[:lower:]" "[:upper:]")))
(list (read-string from)
(map (compose status:exit-val cdr waitpid) pids))))