From 101b1d6496a91b6803d52e9771df903ea7a6ffdf Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Wed, 3 Apr 2013 11:10:08 -0400 Subject: [PATCH] Test for being able to customize struct printouts. original commit: 8ffd8878476732e1e783efaa25a94d54172c950e --- .../tests/typed-racket/succeed/custom-printer.rkt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 collects/tests/typed-racket/succeed/custom-printer.rkt diff --git a/collects/tests/typed-racket/succeed/custom-printer.rkt b/collects/tests/typed-racket/succeed/custom-printer.rkt new file mode 100644 index 00000000..50675788 --- /dev/null +++ b/collects/tests/typed-racket/succeed/custom-printer.rkt @@ -0,0 +1,11 @@ +#lang typed/racket +;; This test ensures that there is some way to customize struct +;; printouts -- if properties are removed or changed, there should be +;; some way to do something equivalent to what's done in this test. +(require mzlib/pconvert-prop) +(struct: foo () + #:property prop:custom-print-quotable 'never + #:property prop:print-convert-constructor-name 'foo + #:property prop:custom-write (λ (x p w?) (display "#foo" p))) +(unless (equal? "#foo #foo" (format "~a ~s" (foo) (foo))) + (error "bad output"))