Lines Matching +refs:char +refs:set +refs:hex +refs:digit
34 ;; Create a string from integer char values, eg. (string-ints 65) => "A"
36 (apply string (map integer->char args)))
48 (pass-if "new string starts at 1st char in stringbuf"
129 (string-set! s2 0 #\F)
136 (string-set! s2 0 #\F)
143 (string-set! s2 0 #\F)
150 (string-set! s2 0 #\F)
202 (pass-if-exception "non-hex char in two-digit hex-escape"
206 (pass-if-exception "non-hex char in four-digit hex-escape"
210 (pass-if-exception "non-hex char in six-digit hex-escape"
214 (pass-if-exception "premature termination of two-digit hex-escape"
218 (pass-if-exception "premature termination of four-digit hex-escape"
222 (pass-if-exception "premature termination of six-digit hex-escape"
226 (pass-if "extra hex digits ignored for two-digit hex escape"
228 (integer->char #xff)))
230 (pass-if "extra hex digits ignored for four-digit hex escape"
232 (integer->char #x0100)))
234 (pass-if "extra hex digits ignored for six-digit hex escape"
236 (integer->char #x010300)))
277 (compile '(string-set! "literal string" 0 #\x)
350 (pass-if "same as char<?"
351 (eq? (char<? (integer->char 0) (integer->char 255))
374 (pass-if "same as char-ci<?"
375 (eq? (char-ci<? (integer->char 0) (integer->char 255))
384 (pass-if "same as char<=?"
385 (eq? (char<=? (integer->char 0) (integer->char 255))
394 (pass-if "same as char-ci<=?"
395 (eq? (char-ci<=? (integer->char 0) (integer->char 255))
404 (pass-if "same as char>?"
405 (eq? (char>? (integer->char 0) (integer->char 255))
414 (pass-if "same as char-ci>?"
415 (eq? (char-ci>? (integer->char 0) (integer->char 255))
424 (pass-if "same as char>=?"
425 (eq? (char>=? (integer->char 0) (integer->char 255))
434 (pass-if "same as char-ci>=?"
435 (eq? (char-ci>=? (integer->char 0) (integer->char 255))
528 (pass-if "regular string, ASCII char"
529 (char=? (string-ref "GNU Guile" 4) #\G))
531 (pass-if "regular string, hex escaped Latin-1 char"
532 (char=? (string-ref "--\xff--" 2)
533 (integer->char #xff)))
535 (pass-if "regular string, hex escaped BMP char"
536 (char=? (string-ref "--\u0100--" 2)
537 (integer->char #x0100)))
539 (pass-if "regular string, hex escaped SMP char"
540 (char=? (string-ref "--\U010300--" 2)
541 (integer->char #x010300))))
544 ;; string-set!
547 (with-test-prefix "string-set!"
551 (string-set! (string-copy "") 0 #\x))
555 (string-set! (string-copy "") 123 #\x))
559 (string-set! (string-copy "hello") 123 #\x))
563 (string-set! (string-copy "hello") -1 #\x))
567 (string-set! (substring/read-only "abc" 0) 1 #\space))
569 (pass-if "regular string, ASCII char"
571 (string-set! s 4 #\G)
572 (char=? (string-ref s 4) #\G)))
574 (pass-if "regular string, Latin-1 char"
576 (string-set! s 4 (integer->char #xfe))
577 (char=? (string-ref s 4) (integer->char #xfe))))
579 (pass-if "regular string, BMP char"
581 (string-set! s 4 (integer->char #x0100))
582 (char=? (string-ref s 4) (integer->char #x0100))))
584 (pass-if "regular string, SMP char"
586 (string-set! s 4 (integer->char #x010300))
587 (char=? (string-ref s 4) (integer->char #x010300)))))
597 (set-cdr! (cddr foo) (cdr foo))
603 (pass-if "char 255"
605 (string-split (string #\a (integer->char 255) #\b)
606 (integer->char 255))))
608 (pass-if "empty string - char"
612 (pass-if "non-empty - char - no delimiters"
616 (pass-if "non-empty - char - delimiters"
620 (pass-if "non-empty - char - leading delimiters"
624 (pass-if "non-empty - char - trailing delimiters"
630 (string-split "" (char-set #\:))))
634 (string-split "foobarfrob" (char-set #\:))))
638 (string-split "foo:bar:frob" (char-set #\:))))
642 (string-split "::foo:bar:frob" (char-set #\:))))
646 (string-split "foo:bar:frob::" (char-set #\:))))
650 (string-split "" (negate char-alphabetic?))))
654 (string-split "foobarfrob" (negate char-alphabetic?))))
658 (string-split "foo:bar:frob" (negate char-alphabetic?))))
662 (string-split "::foo:bar:frob" (negate char-alphabetic?))))
666 (string-split "foo:bar:frob::" (negate char-alphabetic?)))))