summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/redis-cli.tcl6
-rw-r--r--tests/integration/replication-4.tcl2
-rw-r--r--tests/integration/replication.tcl12
3 files changed, 13 insertions, 7 deletions
diff --git a/tests/integration/redis-cli.tcl b/tests/integration/redis-cli.tcl
index 7479ac8b4..e159fb17d 100644
--- a/tests/integration/redis-cli.tcl
+++ b/tests/integration/redis-cli.tcl
@@ -346,7 +346,7 @@ if {!$::tls} { ;# fake_redis_node doesn't support TLS
set dir [lindex [r config get dir] 1]
assert_equal "OK" [r debug populate 100000 key 1000]
- assert_equal "OK" [r function load lua lib1 "redis.register_function('func1', function() return 123 end)"]
+ assert_equal "lib1" [r function load "#!lua name=lib1\nredis.register_function('func1', function() return 123 end)"]
if {$functions_only} {
set args "--functions-rdb $dir/cli.rdb"
} else {
@@ -359,10 +359,10 @@ if {!$::tls} { ;# fake_redis_node doesn't support TLS
file rename "$dir/cli.rdb" "$dir/dump.rdb"
assert_equal "OK" [r set should-not-exist 1]
- assert_equal "OK" [r function load lua should_not_exist_func "redis.register_function('should_not_exist_func', function() return 456 end)"]
+ assert_equal "should_not_exist_func" [r function load "#!lua name=should_not_exist_func\nredis.register_function('should_not_exist_func', function() return 456 end)"]
assert_equal "OK" [r debug reload nosave]
assert_equal {} [r get should-not-exist]
- assert_equal {{library_name lib1 engine LUA description {} functions {{name func1 description {} flags {}}}}} [r function list]
+ assert_equal {{library_name lib1 engine LUA functions {{name func1 description {} flags {}}}}} [r function list]
if {$functions_only} {
assert_equal 0 [r dbsize]
} else {
diff --git a/tests/integration/replication-4.tcl b/tests/integration/replication-4.tcl
index b8c50308a..281d5a8eb 100644
--- a/tests/integration/replication-4.tcl
+++ b/tests/integration/replication-4.tcl
@@ -47,7 +47,7 @@ start_server {tags {"repl external:skip"}} {
set slave [srv 0 client]
# Load some functions to be used later
- $master FUNCTION load lua test replace {
+ $master FUNCTION load replace {#!lua name=test
redis.register_function{function_name='f_default_flags', callback=function(keys, args) return redis.call('get',keys[1]) end, flags={}}
redis.register_function{function_name='f_no_writes', callback=function(keys, args) return redis.call('get',keys[1]) end, flags={'no-writes'}}
}
diff --git a/tests/integration/replication.tcl b/tests/integration/replication.tcl
index 05f62d5e8..44915be1b 100644
--- a/tests/integration/replication.tcl
+++ b/tests/integration/replication.tcl
@@ -523,10 +523,14 @@ foreach testType {Successful Aborted} {
$replica set mykey myvalue
# Set a function value on replica to check status during loading, on failure and after swapping db
- $replica function load LUA test {redis.register_function('test', function() return 'hello1' end)}
+ $replica function load {#!lua name=test
+ redis.register_function('test', function() return 'hello1' end)
+ }
# Set a function value on master to check it reaches the replica when replication ends
- $master function load LUA test {redis.register_function('test', function() return 'hello2' end)}
+ $master function load {#!lua name=test
+ redis.register_function('test', function() return 'hello2' end)
+ }
# Force the replica to try another full sync (this time it will have matching master replid)
$master multi
@@ -659,7 +663,9 @@ test {diskless loading short read} {
set start [clock clicks -milliseconds]
# Set a function value to check short read handling on functions
- r function load LUA test {redis.register_function('test', function() return 'hello1' end)}
+ r function load {#!lua name=test
+ redis.register_function('test', function() return 'hello1' end)
+ }
for {set k 0} {$k < 3} {incr k} {
for {set i 0} {$i < 10} {incr i} {