From 56801372f03c9b7d9e8f2df566a46d745c5e12cd Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 13 Jun 2014 05:42:21 -0500 Subject: [PATCH] add a test for behavior that's not currently liked --- .../racket-test/tests/racket/contract/bug.rkt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/racket-pkgs/racket-test/tests/racket/contract/bug.rkt b/pkgs/racket-pkgs/racket-test/tests/racket/contract/bug.rkt index a1b9295f0a..fbda407b33 100644 --- a/pkgs/racket-pkgs/racket-test/tests/racket/contract/bug.rkt +++ b/pkgs/racket-pkgs/racket-test/tests/racket/contract/bug.rkt @@ -38,4 +38,20 @@ of the desired behavior. (and (exn:fail:contract:blame? x) (regexp-match? #rx"blaming: top-level" ;; the regexp should be #rx"blaming: bad1-client" - (exn-message x)))))) \ No newline at end of file + (exn-message x))))) + + ;; this is a case where recursive-contract cannot easily tell + ;; that it has found a cycle. It's currently supposed to detect + ;; cycles and signal errors, but it doesn't detect this one. + (test/spec-passed + 'recursive-contract14 + '(let () + (struct s (x) #:mutable) + (define an-s (s #f)) + (set-s-x! an-s an-s) + + (define c + (recursive-contract + (struct/c s c))) + + (s-x (s-x (contract c an-s 'pos 'neg))))))