redict/tests/unit/moduleapi/keyspace_events.tcl
Meir Shpilraien (Spielrein) 3f494cc49d
see #7544, added RedisModule_HoldString api. (#7577)
Added RedisModule_HoldString that either returns a
shallow copy of the given String (by increasing
the String ref count) or a new deep copy of String
in case its not possible to get a shallow copy.

Co-authored-by: Itamar Haber <itamar@redislabs.com>
2020-08-09 06:11:47 +03:00

22 lines
758 B
Tcl

set testmodule [file normalize tests/modules/keyspace_events.so]
tags "modules" {
start_server [list overrides [list loadmodule "$testmodule"]] {
test {Test loaded key space event} {
r set x 1
r hset y f v
r lpush z 1 2 3
r sadd p 1 2 3
r zadd t 1 f1 2 f2
r xadd s * f v
r debug reload
assert_equal {1 x} [r keyspace.is_key_loaded x]
assert_equal {1 y} [r keyspace.is_key_loaded y]
assert_equal {1 z} [r keyspace.is_key_loaded z]
assert_equal {1 p} [r keyspace.is_key_loaded p]
assert_equal {1 t} [r keyspace.is_key_loaded t]
assert_equal {1 s} [r keyspace.is_key_loaded s]
}
}
}