mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
1ccf2ca2f4
Previously, passing 0 for newlen would not truncate the string at all. This adds handling of this case, freeing the old string and creating a new empty string. Other changes: - Move `src/modules/testmodule.c` to `tests/modules/basics.c` - Introduce that basic test into the test suite - Add tests to cover StringTruncate - Add `test-modules` build target for the main makefile - Extend `distclean` build target to clean modules too
14 lines
321 B
Tcl
14 lines
321 B
Tcl
set testmodule [file normalize tests/modules/basics.so]
|
|
|
|
|
|
# TEST.CTXFLAGS requires RDB to be disabled, so override save file
|
|
start_server {tags {"modules"} overrides {save ""}} {
|
|
r module load $testmodule
|
|
|
|
test {test module api basics} {
|
|
r test.basics
|
|
} {ALL TESTS PASSED}
|
|
|
|
r module unload test
|
|
}
|