Fix and run string tests.
This commit is contained in:
parent
cf2913fdea
commit
b2da67e4e0
3 changed files with 10 additions and 6 deletions
|
@ -31,6 +31,7 @@
|
|||
string-repeat
|
||||
string-first+rest
|
||||
string-utf8?
|
||||
string-tests!
|
||||
)
|
||||
|
||||
(import scheme
|
||||
|
@ -62,13 +63,13 @@
|
|||
;; Returns true, if given string contains UTF-8 characters
|
||||
(define (string-utf8? str)
|
||||
(let ((asciilen (string-length str))
|
||||
(utf8len (length (irregex-extract (irregex "." 'u)))))
|
||||
(utf8len (length (irregex-extract (irregex "." 'u) str))))
|
||||
(not (= asciilen utf8len))))
|
||||
|
||||
;; Performs utils module self-tests.
|
||||
(define (utils-tests!)
|
||||
(define (string-tests!)
|
||||
(run-tests
|
||||
utils
|
||||
util-string
|
||||
(test-equal? string-repeat
|
||||
(string-repeat "-" 4)
|
||||
"----")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue