Implement string-upcase and document it.
This commit is contained in:
parent
ab0d2cfd8e
commit
c634bf733f
2 changed files with 18 additions and 0 deletions
|
@ -37,6 +37,8 @@
|
|||
|
||||
string->qp
|
||||
|
||||
string-upcase
|
||||
|
||||
string-tests!
|
||||
)
|
||||
|
||||
|
@ -102,6 +104,12 @@
|
|||
"")))
|
||||
res)))))
|
||||
|
||||
;; Returns upper-case version of the string
|
||||
(define (string-upcase str)
|
||||
(list->string
|
||||
(map char-upcase
|
||||
(string->list str))))
|
||||
|
||||
;; Performs utils module self-tests.
|
||||
(define (string-tests!)
|
||||
(run-tests
|
||||
|
@ -129,6 +137,9 @@
|
|||
(test-equal? string->qp
|
||||
(string->qp "asdfásdf")
|
||||
"asdf=c3=a1sdf")
|
||||
(test-equal? string-upcase
|
||||
(string-upcase "asdFGH")
|
||||
"ASDFGH")
|
||||
))
|
||||
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue