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

13 lines
554 B
Scheme
Raw Normal View History

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