Skip to content

redis-lua unit testing #7

@benjaminweb

Description

@benjaminweb

You've done a little but amazing piece of code with redis-lua.
It does a pretty job for a dozen of redis lua scripts for me.

I am glueing together some kind of unit testing for those at the moment.

It works basically. However, the syntax of redis-lua causes hiccup
with %arg and %return syntax.
Can we wrap it into Lua --[[ and --]] comment?

The relevant code seems to be this here:

regions.py:433 r'^\s*%key\s+(?P<name>[\w\d_]+)\s*$',
regions.py:453
r'^\s*%arg\s+(?P<name>[\w\d_]+)(\s+(?P<type>[\w\d_]+))?\s*$',

I considered implementing unit tests for Lua in Python directly by means
of lupa and testing.redis.
However, I feel this introduces unnecessary complexity.

For now, I think the simplest path would be lua directly.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions