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

hget throw assert error #5

Open
guileen opened this issue Mar 13, 2013 · 3 comments
Open

hget throw assert error #5

guileen opened this issue Mar 13, 2013 · 3 comments

Comments

@guileen
Copy link
Contributor

guileen commented Mar 13, 2013

redis.call('hget', 'foo', 'bar')

lua: ./redis-lua-unit/src/commands/hash.lua:22: assertion failed!
stack traceback:
[C]: in function 'assert'
./redis-lua-unit/src/commands/hash.lua:22: in function '?'
./redis-lua-unit/src//RedisLua.lua:20: in function 'call'
test.lua:10: in main chunk
[C]: ?

@FGRibreau
Copy link
Member

The issue came from there but I currently don't have the time to look into it. Please note that I'll happily accept pull requests :)

@guileen
Copy link
Contributor Author

guileen commented Mar 14, 2013

@FGRibreau It's a little complex to mock all redis functions from scratch, like zset is much difficult.
I have found a new way to do the redis_mock, I use the redis lua client, and wrap it to mock redis.call,

My pleasure if you can take a look:
https://github.com/guileen/redis-extras/blob/master/redis-mock.lua#L28-L40

@FGRibreau
Copy link
Member

Nice catch!

But it means you will need a running Redis server, so it may not always be the simplest solution. I'll keep the ticket open for further updates.

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