mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
adding more srfi 130 tests
This commit is contained in:
parent
09dc9f89af
commit
25a8e4f11a
2 changed files with 11 additions and 20 deletions
|
@ -10,6 +10,7 @@
|
||||||
(string-cursor->index str (apply string-index str pred o)))
|
(string-cursor->index str (apply string-index str pred o)))
|
||||||
(define (string-index-right->index str pred . o)
|
(define (string-index-right->index str pred . o)
|
||||||
(string-cursor->index str (apply string-index-right str pred o)))
|
(string-cursor->index str (apply string-index-right str pred o)))
|
||||||
|
(define char-set:not-letter (char-set-complement char-set:letter))
|
||||||
(define (run-tests)
|
(define (run-tests)
|
||||||
(test-begin "srfi-130: cursor-based string library")
|
(test-begin "srfi-130: cursor-based string library")
|
||||||
|
|
||||||
|
@ -126,23 +127,23 @@
|
||||||
|
|
||||||
(test "string-index #1" 4
|
(test "string-index #1" 4
|
||||||
(string-index->index "abcd:efgh:ijkl" (lambda (ch) (eqv? ch #\:))))
|
(string-index->index "abcd:efgh:ijkl" (lambda (ch) (eqv? ch #\:))))
|
||||||
;; (test "string-index #2" 4
|
(test "string-index #2" 4
|
||||||
;; (string-index "abcd:efgh;ijkl" (char-set-complement char-set:letter)))
|
(string-index->index "abcd:efgh;ijkl" (lambda (ch) (char-set-contains? char-set:not-letter ch))))
|
||||||
(test "string-index #3" 14
|
(test "string-index #3" 14
|
||||||
(string-index->index "abcd:efgh;ijkl" (lambda (ch) (char-set-contains? char-set:digit ch))))
|
(string-index->index "abcd:efgh;ijkl" (lambda (ch) (char-set-contains? char-set:digit ch))))
|
||||||
(test "string-index #4" 9
|
(test "string-index #4" 9
|
||||||
(string-index->index "abcd:efgh:ijkl" (lambda (ch) (eqv? ch #\:)) 5))
|
(string-index->index "abcd:efgh:ijkl" (lambda (ch) (eqv? ch #\:)) 5))
|
||||||
(test "string-index-right #1" 5
|
(test "string-index-right #1" 5
|
||||||
(string-index-right->index "abcd:efgh;ijkl" (lambda (ch) (eqv? ch #\:))))
|
(string-index-right->index "abcd:efgh;ijkl" (lambda (ch) (eqv? ch #\:))))
|
||||||
;; (test "string-index-right #2" 9
|
(test "string-index-right #2" 10
|
||||||
;; (string-index-right "abcd:efgh;ijkl" (char-set-complement char-set:letter)))
|
(string-index-right->index "abcd:efgh;ijkl" (lambda (ch) (char-set-contains? char-set:not-letter ch))))
|
||||||
(test "string-index-right #3" 14
|
(test "string-index-right #3" 14
|
||||||
(string-index-right->index "abcd:efgh;ijkl" char-alphabetic?))
|
(string-index-right->index "abcd:efgh;ijkl" char-alphabetic?))
|
||||||
;; (test "string-index-right #4" 4
|
(test "string-index-right #4" 10
|
||||||
;; (string-index-right "abcd:efgh;ijkl" (char-set-complement char-set:letter) 2 5))
|
(string-index-right->index "abcd:efgh;ijkl" (lambda (ch) (char-set-contains? char-set:not-letter ch)) 7))
|
||||||
|
|
||||||
;; (test "string-count #1" 2
|
(test "string-count #1" 2
|
||||||
;; (string-count "abc def\tghi jkl" #\space))
|
(string-count "abc def\tghi jkl" (lambda (ch) (eqv? ch #\space))))
|
||||||
(test "string-count #2" 3
|
(test "string-count #2" 3
|
||||||
(string-count "abc def\tghi jkl" char-whitespace?))
|
(string-count "abc def\tghi jkl" char-whitespace?))
|
||||||
(test "string-count #3" 2
|
(test "string-count #3" 2
|
||||||
|
@ -307,18 +308,6 @@
|
||||||
(test "string-replace" "abcdhi"
|
(test "string-replace" "abcdhi"
|
||||||
(string-replace "abcdefghi" "" 4 7))
|
(string-replace "abcdefghi" "" 4 7))
|
||||||
|
|
||||||
;; (test "string-tokenize" '("Help" "make" "programs" "run," "run," "RUN!")
|
|
||||||
;; (string-tokenize "Help make programs run, run, RUN!"))
|
|
||||||
;; (test "string-tokenize" '("Help" "make" "programs" "run" "run" "RUN")
|
|
||||||
;; (string-tokenize "Help make programs run, run, RUN!"
|
|
||||||
;; char-set:letter))
|
|
||||||
;; (test "string-tokenize" '("programs" "run" "run" "RUN")
|
|
||||||
;; (string-tokenize "Help make programs run, run, RUN!"
|
|
||||||
;; char-set:letter 10))
|
|
||||||
;; (test "string-tokenize" '("elp" "make" "programs" "run" "run")
|
|
||||||
;; (string-tokenize "Help make programs run, run, RUN!"
|
|
||||||
;; char-set:lower-case))
|
|
||||||
|
|
||||||
(test "string-filter" "rrrr"
|
(test "string-filter" "rrrr"
|
||||||
(string-filter (lambda (ch) (eqv? ch #\r))
|
(string-filter (lambda (ch) (eqv? ch #\r))
|
||||||
"Help make programs run, run, RUN!"))
|
"Help make programs run, run, RUN!"))
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
(rename (srfi 69 test) (run-tests run-srfi-69-tests))
|
(rename (srfi 69 test) (run-tests run-srfi-69-tests))
|
||||||
(rename (srfi 95 test) (run-tests run-srfi-95-tests))
|
(rename (srfi 95 test) (run-tests run-srfi-95-tests))
|
||||||
(rename (srfi 99 test) (run-tests run-srfi-99-tests))
|
(rename (srfi 99 test) (run-tests run-srfi-99-tests))
|
||||||
|
(rename (srfi 130 test) (run-tests run-srfi-130-tests))
|
||||||
(rename (chibi base64-test) (run-tests run-base64-tests))
|
(rename (chibi base64-test) (run-tests run-base64-tests))
|
||||||
(rename (chibi crypto md5-test) (run-tests run-md5-tests))
|
(rename (chibi crypto md5-test) (run-tests run-md5-tests))
|
||||||
(rename (chibi crypto rsa-test) (run-tests run-rsa-tests))
|
(rename (chibi crypto rsa-test) (run-tests run-rsa-tests))
|
||||||
|
@ -52,6 +53,7 @@
|
||||||
(run-srfi-69-tests)
|
(run-srfi-69-tests)
|
||||||
(run-srfi-95-tests)
|
(run-srfi-95-tests)
|
||||||
(run-srfi-99-tests)
|
(run-srfi-99-tests)
|
||||||
|
(run-srfi-130-tests)
|
||||||
(run-base64-tests)
|
(run-base64-tests)
|
||||||
(run-doc-tests)
|
(run-doc-tests)
|
||||||
(run-generic-tests)
|
(run-generic-tests)
|
||||||
|
|
Loading…
Add table
Reference in a new issue