From 608ad38794730749ec7a82c514a93179a16f737f Mon Sep 17 00:00:00 2001 From: Yarin Heffes Date: Fri, 18 Oct 2024 10:34:16 -0700 Subject: [PATCH] added unit test for into-iter bug i1198 --- tests/runtime-tests.lisp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/runtime-tests.lisp b/tests/runtime-tests.lisp index bc63cda09..fe56581a3 100644 --- a/tests/runtime-tests.lisp +++ b/tests/runtime-tests.lisp @@ -191,3 +191,18 @@ (define-test test-transparent-wrapper () (is (== (make-list "x") (map .inner (make-list (TransparentWrapper "x")))))) + +;; Test iter:into-iter (see i1198) + +(coalton-toplevel + (define (gh-974) + (iter:into-iter iter:Empty)) + (define (gh-975) + (iter:into-iter Nil)) + (define (gh-976) + (iter:into-iter (iter:into-iter iter:Empty)))) + +(define-test test-into-iter-iter-empty () + (is (none? (iter:next! (gh-974)))) + (is (none? (iter:next! (gh-975)))) + (is (none? (iter:next! (gh-976)))))