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
|
#!/usr/bin/env csi -script
(use test)
(include "ducttape-lib.scm")
(import ducttape-lib)
(import ansi-escape-sequences)
(use trace)
(set! systype (do-or-die (if (file-exists? "/bin/uname") "/bin/uname" "/usr/bin/uname")))
;(trace skim-cmdline-opts-withargs-by-regex)
;(trace keyword-skim)
;(trace re-match?)
(define (reset-ducttape)
(unsetenv "ducttape_DEBUG_LEVEL")
(ducttape-debug-level #f)
(unsetenv "ducttape_DEBUG_PATTERN")
(ducttape-debug-regex-filter ".")
(unsetenv "ducttape_LOG_FILE")
(ducttape-log-file #f)
(unsetenv "ducttape_SILENT_MODE")
(ducttape-silent-mode #f)
(unsetenv "ducttape_QUIET_MODE")
(ducttape-quiet-mode #f)
(unsetenv "ducttape_COLOR_MODE")
(ducttape-color-mode #f)
)
(define (reset-ducttape-with-cmdline-list cmdline-list)
(reset-ducttape)
(command-line-arguments cmdline-list)
(ducttape-process-command-line)
)
(define (direct-iputs-test)
(ducttape-color-mode #f)
(ierr "I'm an error")
(iwarn "I'm a warning")
|
|
|
|
|
|
|
|
|
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
|
#!/usr/bin/env csi -script
(use test)
(include "ducttape-lib.scm")
(import ducttape-lib)
(import ansi-escape-sequences)
(use trace)
(set! systype (do-or-die (if (file-exists? "/bin/uname") "/bin/uname" "/usr/bin/uname")))
;(trace skim-cmdline-opts-withargs-by-regex)
;(trace keyword-skim)
;(trace re-match?)
(define (reset-ducttape)
(unsetenv "DUCTTAPE_DEBUG_LEVEL")
(ducttape-debug-level #f)
(unsetenv "DUCTTAPE_DEBUG_PATTERN")
(ducttape-debug-regex-filter ".")
(unsetenv "DUCTTAPE_LOG_FILE")
(ducttape-log-file #f)
(unsetenv "DUCTTAPE_SILENT_MODE")
(ducttape-silent-mode #f)
(unsetenv "DUCTTAPE_QUIET_MODE")
(ducttape-quiet-mode #f)
(unsetenv "DUCTTAPE_COLOR_MODE")
(ducttape-color-mode #f)
)
(define (reset-ducttape-with-cmdline-list cmdline-list)
(reset-ducttape)
(command-line-arguments cmdline-list)
(process-command-line)
)
(define (direct-iputs-test)
(ducttape-color-mode #f)
(ierr "I'm an error")
(iwarn "I'm a warning")
|
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
(let-values (((ec o e) (isys "/bin/ls /zzzzz")))
(let ((expected-code
(if (equal? systype "Darwin") 1 2))
(expected-err
(if (equal? systype "Darwin")
"ls: /zzzzz: No such file or directory"
"/bin/ls: .* /zzzzz: No such file or directory"))
)
(test "isys: /bin/ls /zzzzz should have exit code 2" expected-code ec)
(test "isys: /bin/ls /zzzzz should have empty stdout" "" o)
(test
"isys: /bin/ls /zzzzz should have stderr"
expected-err
|
|
|
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
(let-values (((ec o e) (isys "/bin/ls /zzzzz")))
(let ((expected-code
(if (equal? systype "Darwin") 1 2))
(expected-err
(if (equal? systype "Darwin")
"ls: /zzzzz: No such file or directory"
"/bin/ls: cannot access /zzzzz: No such file or directory"))
)
(test "isys: /bin/ls /zzzzz should have exit code 2" expected-code ec)
(test "isys: /bin/ls /zzzzz should have empty stdout" "" o)
(test
"isys: /bin/ls /zzzzz should have stderr"
expected-err
|