;;;; symbol-utils-test.scm -*- Scheme -*- ;;;; Kon Lovett, Jul '18 (import test) (test-begin "Symbol Utils") ;;; (import symbol-utils) (test 'foo (keyword->symbol #:foo)) (test "foo" (symbol->string (keyword->uninterned-symbol #:foo))) (test #:foo (symbol->keyword 'foo)) (test-assert (unbound-value? (unbound-value))) (test-assert (symbol-value symbol->keyword #f)) (test-assert (unspecified? (unspecified-value))) (test-assert (symbol-printname=? 'foo 'foo)) (test-assert (not (symbol-printname=? 'foo 'bar))) (test-assert (symbol-printname=? '##sys#list->string '##sys#list->string)) (test-assert (not (symbol-printname=? '##sys#list->string 'list->string))) (test-assert (not (symbol-printnamestring '##sys#list->string))) #;(test-assert (symbol-printnamestring '##sys#list->string)) (test-assert (symbol-printname-ci=? 'foo 'FOO)) (test-assert (not (symbol-printname-ci=? 'foo 'BAR))) (test-assert (symbol-printname-ci=? '##sys#list->string '##sys#list->STRING)) (test-assert (not (symbol-printname-ci=? '##sys#list->string 'list->STRING))) (test-assert (not (symbol-printname-cistring '##sys#list->STRING))) #;(test-assert (symbol-printname-cistring '##sys#list->STRING)) (test 3 (symbol-printname-length 'foo)) (test 3 (max-symbol-printname-length '(a abc ab))) #;(test '##foo#bar (make-qualified-symbol "foo" 'bar)) #;(test-assert (qualified-symbol? '##sys#list->string)) #;(test-assert (not (qualified-symbol? 'sym))) #;(test "##sys#list->string" (symbol->qualified-string '##sys#list->string)) #;(test "list->string" (symbol->qualified-string 'list->string)) (test-assert (interned-symbol? 'foo)) (test-assert (not (interned-symbol? (gensym)))) #;(test-assert (not (interned-symbol? (make-qualified-uninterned-symbol "bar" 'foo)))) ;;; (test-end "Symbol Utils") (test-exit)