pixie-lang / dust

Magic fairy dust for pixie, i.e. tooling around the language.
GNU Lesser General Public License v3.0
93 stars 14 forks source link

dust test with examples broken? #23

Closed sherzberg closed 8 years ago

sherzberg commented 8 years ago

I just compiled the pixie-vm and put dust on my path from a fresh checkout of this repo and am having trouble getting the example/tests projects working. Any ideas on what I am doing wrong?

spencerherzberg@spencerherzberg-mbp~/workspace/dust/examples/tests[master]
$ dust test
[/Users/spencerherzberg/workspace/pixie /Users/spencerherzberg/workspace/pixie/lib /Users/spencerherzberg/workspace/pixie/include /Users/spencerherzberg/workspace/pixie/../lib /Users/spencerherzberg/workspace/pixie/../include . /Users/spencerherzberg/workspace/dust/src ./src]
Looking for tests...
Loading  /Users/spencerherzberg/workspace/dust/examples/tests/test/test-core.pxi
Running: 1 tests
Running: test-core/test-greet
while running test-greet   (do (t/assert= (greet Jane) Hello, Jane!))
in pixie function test-greet_fn

in /Users/spencerherzberg/workspace/dust/examples/tests/test/test-core.pxi at 6:15
  (t/assert= (greet "Jane") "Hello, Jane!"))
              ^
RuntimeException: :pixie.stdlib/AssertionException Var greet is undefined

{:fail 1, :errors [in pixie function test-greet_fn

in /Users/spencerherzberg/workspace/dust/examples/tests/test/test-core.pxi at 6:15
  (t/assert= (greet "Jane") "Hello, Jane!"))
              ^
RuntimeException: :pixie.stdlib/AssertionException Var greet is undefined
], :pass 0}

However this works just fine:

spencerherzberg@spencerherzberg-mbp~/workspace/dust/examples/tests[master]
$ dust
user => (use 'core)
nil
user => (greet "Spencer")
"Hello, Spencer!"
heyLu commented 8 years ago

You're doing nothing wrong. This is definitely a bug.

The same thing happens when you run the following in the repl:

user => (ns xyz (use 'core))
nil
xyz => greet
ERROR: 
 in pixie function repl_fn

in pixie/repl.pxi at 24:24
               (let [x (eval form)]
                       ^
in internal function eval

in <unknown> at 2:1
greet
^
RuntimeException: :pixie.stdlib/AssertionException Var greet is undefined

It does not happen when you move the use call outside of the ns form.

heyLu commented 8 years ago

(And I pushed before posting that comment.)

The problem was that this syntax (use inside ns) isn't supported anymore.

sherzberg commented 8 years ago

Ah, that makes sense! Thank you for a quick response!