From 44ffcae006bb28ee4a03340bab2c79da5023b324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 6 Jun 2010 12:25:57 +0200 Subject: [PATCH] Add tests for `procedure-name'. This is a followup to 22cf27c815b756cac6893b5b239898767e6cb498 ("fix procedure naming"). * test-suite/tests/compiler.test ("procedure-name"): New test prefix. --- test-suite/tests/compiler.test | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/test-suite/tests/compiler.test b/test-suite/tests/compiler.test index 6d433ebac..f03d4dd20 100644 --- a/test-suite/tests/compiler.test +++ b/test-suite/tests/compiler.test @@ -1,5 +1,5 @@ ;;;; 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 ;;;; modify it under the terms of the GNU Lesser General Public @@ -105,3 +105,21 @@ (compile '(eval-when (compile eval) (fluid-set! current-reader (lambda args 'chbouib)))) (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)))