From: Taylor R Campbell Date: Fri, 9 Aug 2019 16:53:43 +0000 (+0000) Subject: Test hashed object notation. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~100 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=f41ab69f41c0c0ecb80669af5a37f7ae94e4ed4f;p=mit-scheme.git Test hashed object notation. Currently busted for #[foo 123]. --- diff --git a/tests/runtime/test-readwrite.scm b/tests/runtime/test-readwrite.scm index 7ffe76cb2..ef556bf9a 100644 --- a/tests/runtime/test-readwrite.scm +++ b/tests/runtime/test-readwrite.scm @@ -259,4 +259,21 @@ USA. (lambda (string #!optional xfail) (with-expected-failure xfail (lambda () - (assert-error (lambda () (read-from-string string))))))) \ No newline at end of file + (assert-error (lambda () (read-from-string string))))))) + +(define-structure twonky + fnord) + +(define-test 'hash + (lambda () + (let* ((object (make-twonky 123)) + (hash (hash-object object)) + (string (string-append "#[twonky " (number->string hash) "]")) + (abbrev (string-append "#@" (number->string hash)))) + (assert-equal (write-to-string object) string) + (expect-error + (lambda () + (assert-eq (eval (read-from-string string) system-global-environment) + object))) + (assert-eq (eval (read-from-string abbrev) system-global-environment) + object)))) \ No newline at end of file