Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't run tests #3

Open
amir-arad opened this issue Dec 29, 2017 · 5 comments
Open

can't run tests #3

amir-arad opened this issue Dec 29, 2017 · 5 comments

Comments

@amir-arad
Copy link

I'm new to lua. I'm trying to run the tests after installing luarocks and busted.
at the project's root I run busted test, and I get errors of the form:

Error → test/cron_spec.lua @ 1
Cron
./src/lively_epsilon/init.lua:47: module 'utils' not found:No LuaRocks module found for utils
        no field package.preload['utils']
        no file './src/utils.lua'
        no file './src/utils/utils.lua'
        no file './src/utils/init.lua'
...

if I comment out "utils.lua" line in init.lua, I get most of the tests passing, but 1 failure:


Failure → test/util_spec.lua @ 161
Util mkString() with lastSeparator parameter should return a string for three values when using an indexed table
test/util_spec.lua:164: Expected objects to be equal.
Passed in:
(string) 'one, two and three'
Expected:
(string) 'two, three and one'


@czenker
Copy link
Owner

czenker commented Dec 29, 2017

Hm... these look like two strange issues. I'm also pretty new to Lua, so I don't have a silver bullet.

Can you tell me which versions of Lua an Busted you are running?

@amir-arad
Copy link
Author

I think it needs "utils.lua" from the empty epsilon scripts folder to be there.
are you running it from the script folder? did you set up some kind of symlink or path variable?

@czenker
Copy link
Owner

czenker commented Dec 29, 2017

Yeah - thats the problematic file.

I did nothing fancy in my setup. Just run from the scripts folder. In the lower part of the init.lua i did some tinkering with the path, because require works differently on CLI than it does in EE.

If you want to debug it (and I would be happy if you did ;) ) , maybe start with printing the package.path variable in lua (and maybe post it here).

But I'm still confused on the failing test. I know tables in Lua are badass, but this behavior is just rude... :)

@amir-arad
Copy link
Author

amir-arad commented Dec 31, 2017

I mostly work with javascript these days. I laugh at the general direction of lua tables.

Will have a deeper look at it.

@czenker
Copy link
Owner

czenker commented Dec 31, 2017

Hey. I could reproduce the issue with Lua 5.3 and basically just removed the test, because it tests a feature which is not needed.

The issue is that for associative tables in lua ({a="foo", b="bar"}) the order of keys is not maintained and it therefor generates unpredictable, random results.

As for the failing run of busted: It does work for me with Lua 5.3.4 and busted 2.0.rc12 on a Fedora.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants