1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +02:00

Add tests for `procedure-name'.

This is a followup to 22cf27c815 ("fix
procedure naming").

* test-suite/tests/compiler.test ("procedure-name"): New test prefix.
This commit is contained in:
Ludovic Courtès 2010-06-06 12:25:57 +02:00
parent 625b43acc7
commit 44ffcae006

View file

@ -1,5 +1,5 @@
;;;; compiler.test --- tests for the compiler -*- scheme -*- ;;;; compiler.test --- tests for the compiler -*- scheme -*-
;;;; Copyright (C) 2008, 2009 Free Software Foundation, Inc. ;;;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
;;;; ;;;;
;;;; This library is free software; you can redistribute it and/or ;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public ;;;; modify it under the terms of the GNU Lesser General Public
@ -105,3 +105,21 @@
(compile '(eval-when (compile eval) (compile '(eval-when (compile eval)
(fluid-set! current-reader (lambda args 'chbouib)))) (fluid-set! current-reader (lambda args 'chbouib))))
(eq? (fluid-ref current-reader) r)))) (eq? (fluid-ref current-reader) r))))
(with-test-prefix "procedure-name"
(pass-if "program"
(let ((m (make-module)))
(beautify-user-module! m)
(compile '(define (foo x) x) #:env m)
(eq? (procedure-name (module-ref m 'foo)) 'foo)))
(pass-if "program with lambda"
(let ((m (make-module)))
(beautify-user-module! m)
(compile '(define foo (lambda (x) x)) #:env m)
(eq? (procedure-name (module-ref m 'foo)) 'foo)))
(pass-if "subr"
(eq? (procedure-name waitpid) 'waitpid)))