From 9e42e3c971c2c1c69d2e03752735bbbd24007b6b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 4 Apr 2024 19:48:34 -0700 Subject: New functions for filtering through external processes. * stdlib/getput.tl (sys:maproc-common): new function. (map-command-lines, map-command-str, map-command-buf, map-process-lines, map-process-str, map-process-buf): New functions. * autoload.c (getput_set_entries): Trigger autoload of getput module on new function symbols. * tests/018/getput.tl: New tests. * txr.1: Documented. --- tests/018/getput.tl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/018/getput.tl') diff --git a/tests/018/getput.tl b/tests/018/getput.tl index 7e8e2be1..ed5a4e5f 100644 --- a/tests/018/getput.tl +++ b/tests/018/getput.tl @@ -31,3 +31,11 @@ (true (contains "syntax error" errors)) t (true (contains "unterminated" errors)) t (true (contains ":1" errors)) t)) + +(mtest + (map-command-lines "tr '[a-z]' '[A-Z]'" '#"a b c") #"A B C" + (map-process-lines "tr" '#"[a-z] [A-Z]" '#"a b c") #"A B C" + (map-command-str "tr '[a-z]' '[A-Z]'" "abc") "ABC" + (map-process-str "tr" '#"[a-z] [A-Z]" "abc") "ABC" + (map-command-buf "tr '[a-z]' '[A-Z]'" #b'616263') #b'414243' + (map-process-buf "tr" '#"[a-z] [A-Z]" #b'616263') #b'414243') -- cgit v1.2.3