blob: 9c0a878de1fb0b8700293509aeaa284437e563f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
(load "../common")
(defvarl file "getput.data")
(push-after-load (remove-path file))
(file-put-objects file '(1 2.3 (a . b) "foo"))
(test
(file-get-lines file) ("1" "2.3" "(a . b)" "\"foo\""))
(file-append-objects file '(#(nil)))
(mtest
(file-get-lines file) ("1" "2.3" "(a . b)" "\"foo\"" "#(nil)")
(file-get-objects file) (1 2.3 (a . b) "foo" #(nil)))
(mtest
(read-objects "(a . b) #\\c") ((a . b) #\c)
(read-objects "(a") :error)
(file-put-string file "(a")
(mtest
(file-get file) :error
(file-get-objects file) :error)
(let ((errors (with-out-string-stream (err)
(ignerr (file-get-objects file : err)))))
(mtest
(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')
(each-prod ((sz 0..10000..1000)
(off 0..16000..2000))
(mvtest
(file-get-buf txr-exe-path sz off)
(command-get-buf `cat '@{txr-exe-path}'` sz off)))
|