~ chicken-core (chicken-5) de762521e88fba63d7e1ad9dcfa4e091b87aebf4
commit de762521e88fba63d7e1ad9dcfa4e091b87aebf4 Author: Peter Bex <peter@more-magic.net> AuthorDate: Sun Aug 1 15:35:44 2021 +0200 Commit: Evan Hanson <evhan@foldling.org> CommitDate: Fri Aug 6 11:19:34 2021 +1200 Add regression test for #1771 This bug was fixed by the fix for #1772, but this was supposed to only be a performance improvement, so the fix was "accidental" (and, accordingly, there was no change to the test suite). Therefore it's a good idea to add a regression test. Signed-off-by: Evan Hanson <evhan@foldling.org> diff --git a/NEWS b/NEWS index 899ddb2f..91507e1d 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,8 @@ - Module system - Reexported macros now work when the reexporting module redefines identifiers from the original (fixes #1757, reported by Sandra Snan). + - When using "except" in "import" to omit reexported macros, + they are really not imported (#1771, reported by Sandra Snan). - Runtime system - Sleeping primordial thread doesn't forget mutations made to diff --git a/distribution/manifest b/distribution/manifest index 53aeaa4f..00a8c515 100644 --- a/distribution/manifest +++ b/distribution/manifest @@ -198,6 +198,8 @@ tests/reexport-m5.scm tests/reexport-m6.scm tests/reexport-m7.scm tests/reexport-m8.scm +tests/reexport-m9.scm +tests/reexport-m10.scm tests/reexport-tests.scm tests/reexport-tests-2.scm tests/ec.scm diff --git a/tests/reexport-m10.scm b/tests/reexport-m10.scm new file mode 100644 index 00000000..f485bad2 --- /dev/null +++ b/tests/reexport-m10.scm @@ -0,0 +1,3 @@ +(module reexport-m10 () + (import (only reexport-m9 define) (chicken module)) + (reexport (only reexport-m9 define))) diff --git a/tests/reexport-m9.scm b/tests/reexport-m9.scm new file mode 100644 index 00000000..8bc3a425 --- /dev/null +++ b/tests/reexport-m9.scm @@ -0,0 +1,6 @@ +(module reexport-m9 (define) + (import (only scheme define-syntax syntax-rules) (only (chicken base) error)) + (define-syntax define + (syntax-rules () + ((_ a b) + (error "wrong define!"))))) diff --git a/tests/reexport-tests-2.scm b/tests/reexport-tests-2.scm index fbaad6cf..8f57808b 100644 --- a/tests/reexport-tests-2.scm +++ b/tests/reexport-tests-2.scm @@ -11,3 +11,8 @@ (import reexport-m8) (assert (equal? '(d c b a) (reexported-reverse '(a b c d)))) (assert (equal? '(d c b a) (reexported-local-reverse '(a b c d)))) + +;; Regression test for #1771 where reexports would get ignored by +;; "except" specifier. +(import (except reexport-m10 define)) +(define something 1) ;; If reexport messed up, this would be syntax from reexport-m9 expanding to (error ...) diff --git a/tests/runtests.bat b/tests/runtests.bat index b696899c..8411ec72 100644 --- a/tests/runtests.bat +++ b/tests/runtests.bat @@ -334,6 +334,10 @@ if errorlevel 1 exit /b 1 if errorlevel 1 exit /b 1 %compile_s% reexport-m8.scm -J if errorlevel 1 exit /b 1 +%compile_s% reexport-m9.scm -J +if errorlevel 1 exit /b 1 +%compile_s% reexport-m10.scm -J +if errorlevel 1 exit /b 1 %compile% reexport-tests-2.scm if errorlevel 1 exit /b 1 a.out diff --git a/tests/runtests.sh b/tests/runtests.sh index 11503b3c..e7dd37b3 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -264,6 +264,8 @@ $compile_s reexport-m5.scm -J $compile_s reexport-m6.scm -J $compile_s reexport-m7.scm -J $compile_s reexport-m8.scm -J +$compile_s reexport-m9.scm -J +$compile_s reexport-m10.scm -J $compile reexport-tests-2.scm ./a.outTrap