[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Need help understanding "include" behaviour
From: |
Bahman Movaqar |
Subject: |
[Chicken-users] Need help understanding "include" behaviour |
Date: |
Sun, 14 Dec 2014 17:55:35 +0330 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
Since the number of tests in my program is growing, I decided to break
the tests into separate files --one file per module. So, for example, I
have a file named "misc.scm" with "misc" module defined inside. In the
tests/ folder I have a "misc-tests.scm" file.
So in "run.scm" I do something like:
(use test)
(include "misc-tests")
...
(test-exit)
And in "misc-tests.scm" I have something like below:
(use test)
(load "../misc")
(import misc)
(test-group "misc"
...
However when running `chicken-install -test` I get the following error:
Error: (import) during expansion of (import ...) - cannot import
from undefined module: misc
Now if I move the (load) and (import) expressions from "misc-tests" to
"run", everything works fine. What's the logic behind this behaviour of
"include" [1]? I'd appreciate if someone would shed a light on this.
[1] Of course I have already read "include" docs
(http://api.call-cc.org/doc/chicken/special-forms/include) to no avail.
TIA,
--
Bahman Movaqar
http://BahmanM.com - https://twitter.com/bahman__m
https://github.com/bahmanm - https://gist.github.com/bahmanm
PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)
signature.asc
Description: OpenPGP digital signature
- [Chicken-users] Need help understanding "include" behaviour,
Bahman Movaqar <=