From: Slobodan Blazeski on 6 Mar 2010 13:10 Suppose I have a package (defpackage #:foo (:use :cl)) (in-package #:foo) (defun triple (x) (* 3 x)) Triple is an internal for the foo package. Then I have a package foo- test. (defpackage #:foo-test (:use :cl :foo :some-test-library)) (in-package #:foo-test) How do you write tests for internal symbols such as triple? Do you prefix them or import them into the test package? Slobodan
From: Tamas K Papp on 6 Mar 2010 14:19 On Sat, 06 Mar 2010 10:10:32 -0800, Slobodan Blazeski wrote: > Suppose I have a package > (defpackage #:foo (:use :cl)) > (in-package #:foo) > > (defun triple (x) (* 3 x)) > > Triple is an internal for the foo package. Then I have a package foo- > test. > (defpackage #:foo-test (:use :cl :foo :some-test-library)) (in-package > #:foo-test) > > How do you write tests for internal symbols such as triple? Do you > prefix them or import them into the test package? Either way is fine, choose what is convenient. I usually import the internal symbols I need into unit-test packages. Tamas
From: Mirko on 7 Mar 2010 19:41 On Mar 6, 1:10 pm, Slobodan Blazeski <slobodan.blaze...(a)gmail.com> wrote: > Suppose I have a package > (defpackage #:foo (:use :cl)) > (in-package #:foo) > > (defun triple (x) (* 3 x)) > > Triple is an internal for the foo package. Then I have a package foo- > test. > (defpackage #:foo-test (:use :cl :foo :some-test-library)) > (in-package #:foo-test) > > How do you write tests for internal symbols such as triple? Do you > prefix them or import them into the test package? > > Slobodan So far I have been using lisp-unit only. In addition for correctness, I use the unit-testing file to test symbol exports as well. Thus, to test unexported symbols, I have to prefix them. This off-course, will not flag an erroneously exported symbol. Mirko
|
Pages: 1 Prev: how to remove all elements from an array Next: How to delete array element by its index? |