p5-RedisDB / RedisDB

Perl extension to access Redis
22 stars 11 forks source link

I get a different error message, so t/00-auth.t fails #37

Closed Tux closed 3 years ago

Tux commented 3 years ago
t/auth.t ................... 1/?
#   Failed test 'dies on reconnect if password is wrong'
#   at t/auth.t line 21.
# expecting: Regexp ((?^i:invalid password))
# found: WRONGPASS invalid username-password pair at t/auth.t line 21.
# Looks like you failed 1 test of 7.
t/auth.t ................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/7 subtests
Linux 5.10.7-1-default [openSUSE Tumbleweed 20210115]  HP ZBook 15G3 Core(TM) i7-6820HQ CPU @ 2.70GHz/3320(8 cores) x86_64  32020 Mb
This is perl 5, version 32, subversion 0 (v5.32.0) built for x86_64-linux-thread-multi-ld
libhiredis0_13-0.13.3-1.16.x86_64
redis-6.0.9-1.1.x86_64
Tux commented 3 years ago

The fix:

--- t/auth.t.org        2021-01-18 14:08:22.011255737 +0100
+++ t/auth.t    2021-01-18 14:08:24.879333184 +0100
@@ -18,7 +18,7 @@ if ( $redis->version >= 2 ) {
     is $redis->get("Database"), 1, "Selected database 1";
     $redis->{password} = 'wrong';
     delete $redis->{_socket};
-    throws_ok { $redis->ping } qr/invalid password/i, "dies on reconnect if password is wrong";
+    throws_ok { $redis->ping } qr/invalid (?:username-)?password/i, "dies on reconnect if password is wrong";
 }
 else {
     diag "Can't finish test, requires redis-server version 2.0.0 and above";

All tests (now) PASS