fix printing of namespace with places enabled

This commit goes with 62acb298bd.
This commit is contained in:
Matthew Flatt 2011-07-16 21:12:22 -06:00
parent ab0e78122c
commit 701c9666d6
2 changed files with 18 additions and 1 deletions

View File

@ -501,6 +501,23 @@
(let ([n-ns (eval '(module->namespace ''n) ns)])
(test 5 eval '(lambda (x) x) n-ns)))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check printing of resolved module paths
(let ([s (open-output-string)])
(print (make-resolved-module-path (build-path (current-directory) "a.rkt")) s)
(test #t regexp-match? #rx"<resolved-module-path:\"" (get-output-string s)))
(let ([s (open-output-string)])
(print (make-resolved-module-path 'other) s)
(test #t regexp-match? #rx"<resolved-module-path:'" (get-output-string s)))
(let ([s (open-output-string)])
(print (module->namespace 'scheme/base) s)
(test #t regexp-match? #rx"<namespace:\"" (get-output-string s)))
(let ([s (open-output-string)])
(print (module->namespace ''n) s)
(test #t regexp-match? #rx"<namespace:'" (get-output-string s)))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)

View File

@ -2565,7 +2565,7 @@ print(Scheme_Object *obj, int notdisplay, int compact, Scheme_Hash_Table *ht,
int is_sym;
modname = ((Scheme_Env *)obj)->module->modname;
is_sym = SCHEME_SYMBOLP(SCHEME_PTR_VAL(modname));
is_sym = !SCHEME_PATHP(SCHEME_PTR_VAL(modname));
print_utf8_string(pp, (is_sym ? "'" : "\""), 0, 1);
print(SCHEME_PTR_VAL(modname), 0, 0, ht, mt, pp);
PRINTADDRESS(pp, modname);