diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:40:55 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:40:55 +0100 |
| commit | 5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda (patch) | |
| tree | 1acdfa5220cd13b7be43a2a01368e80d306473ca /examples/redis-unstable/tests/unit/moduleapi/eventloop.tcl | |
| parent | c7ab12bba64d9c20ccd79b132dac475f7bc3923e (diff) | |
| download | crep-5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda.tar.gz | |
Add Redis source code for testing
Diffstat (limited to 'examples/redis-unstable/tests/unit/moduleapi/eventloop.tcl')
| -rw-r--r-- | examples/redis-unstable/tests/unit/moduleapi/eventloop.tcl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/redis-unstable/tests/unit/moduleapi/eventloop.tcl b/examples/redis-unstable/tests/unit/moduleapi/eventloop.tcl new file mode 100644 index 0000000..ba0d4a2 --- /dev/null +++ b/examples/redis-unstable/tests/unit/moduleapi/eventloop.tcl | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | set testmodule [file normalize tests/modules/eventloop.so] | ||
| 2 | |||
| 3 | start_server {tags {"modules external:skip"}} { | ||
| 4 | r module load $testmodule | ||
| 5 | |||
| 6 | test "Module eventloop sendbytes" { | ||
| 7 | assert_match "OK" [r test.sendbytes 5000000] | ||
| 8 | assert_match "OK" [r test.sendbytes 2000000] | ||
| 9 | } | ||
| 10 | |||
| 11 | test "Module eventloop iteration" { | ||
| 12 | set iteration [r test.iteration] | ||
| 13 | set next_iteration [r test.iteration] | ||
| 14 | assert {$next_iteration > $iteration} | ||
| 15 | } | ||
| 16 | |||
| 17 | test "Module eventloop sanity" { | ||
| 18 | r test.sanity | ||
| 19 | } | ||
| 20 | |||
| 21 | test "Module eventloop oneshot" { | ||
| 22 | r test.oneshot | ||
| 23 | } | ||
| 24 | |||
| 25 | test "Unload the module - eventloop" { | ||
| 26 | assert_equal {OK} [r module unload eventloop] | ||
| 27 | } | ||
| 28 | } | ||
