Hi all,

As Evan found out, my fix for #1772 happened to also fix #1771, but
that was not what I expected.  So, I think it's a good idea to add a
regression test so that the bug can't sneak back in when we make
further changes to the import stuff.

Cheers,
Peter
From 084b189e6adaf4809649ee44e72bec0c8115b0cd Mon Sep 17 00:00:00 2001
From: Peter Bex <pe...@more-magic.net>
Date: Sun, 1 Aug 2021 15:35:44 +0200
Subject: [PATCH] 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.
---
 NEWS                       | 2 ++
 distribution/manifest      | 2 ++
 tests/reexport-tests-2.scm | 5 +++++
 tests/runtests.bat         | 4 ++++
 tests/runtests.sh          | 2 ++
 5 files changed, 15 insertions(+)

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-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.out
 
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature

Reply via email to