summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-06-06 12:25:57 +0200
committerLudovic Courtès <ludo@gnu.org>2010-06-06 16:59:01 +0200
commit44ffcae006bb28ee4a03340bab2c79da5023b324 (patch)
tree2e4801751e1a718a0886bb5e548c1852c8d78a1e
parent625b43acc758fad6174ca3731b57b55e85256934 (diff)
downloadguile-44ffcae006bb28ee4a03340bab2c79da5023b324.tar.gz
Add tests for `procedure-name'.
This is a followup to 22cf27c815b756cac6893b5b239898767e6cb498 ("fix procedure naming"). * test-suite/tests/compiler.test ("procedure-name"): New test prefix.
-rw-r--r--test-suite/tests/compiler.test20
1 files changed, 19 insertions, 1 deletions
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)))