From 142c36c13de9f9e5e02cef965fb6517235699dd4 Mon Sep 17 00:00:00 2001 From: Greg Hendershott Date: Tue, 21 Jan 2025 12:04:36 -0500 Subject: [PATCH] Improve dynamic require of requires analysis Skip tests under some conditions, with explicit message. Issue error, if any, on the command thread so message is reflected up to Emacs for users to see. --- racket/commands/requires.rkt | 57 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/racket/commands/requires.rkt b/racket/commands/requires.rkt index 9c59becb..796ad6a7 100644 --- a/racket/commands/requires.rkt +++ b/racket/commands/requires.rkt @@ -55,42 +55,43 @@ "(require net/url\n (combine-in net/url\n racket/format))") (replace 39 42 "(require net/uri-codec\n net/url)"))) - ;; On older Rackets macro-debugger/analysis/check-requires might - ;; give error: - ;; - ;; derivation-parser: error on token #2: > - (when (version<=? "8.14" (version)) - (check-equal? - (requires/trim p) - '((delete 174 17) - (replace - 129 - 44 - "(require net/url\n (combine-in net/url\n racket/format))") - (replace 39 42 "(require net/uri-codec\n net/url)"))) - (check-equal? - (requires/base p) - '((delete 174 17) - (replace - 129 - 44 - "(require (for-syntax racket/base)\n net/url\n (combine-in net/url\n racket/format)\n racket/list\n racket/match)") - (replace 39 42 "(require net/uri-codec\n net/url)")))))) + (cond + [(not show-requires) + (displayln "Skipping requires analysis tests (macro-debugger-text-lib seemingly not installed).")] + ;; On older Rackets macro-debugger/analysis/check-requires might + ;; give error: + ;; derivation-parser: error on token #2: > + [(versionpath path-str))) (parameterize ([current-load-relative-directory base] [current-directory base])