1
0
Fork 0
lesson-lisp/tests/type_conv.scm

15 lines
577 B
Scheme
Raw Normal View History

2023-05-06 16:58:11 +00:00
(begin
2023-05-06 19:13:35 +00:00
;;; number->string ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(assert-equal "123" (number->string 123))
;(assert-equal "-123" (number->string -123))
(assert-equal "1e240" (number->string 123456 16))
;;; string->symbol ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;(assert-equal '|| (string->symbol ""))
;(assert-equal '| | (string->symbol " "))
(assert-equal 'foo (string->symbol "foo"))
;;; symbol->string ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(assert-equal "foo" (symbol->string 'foo))
2023-05-06 16:58:11 +00:00
)