@@ -116,47 +116,51 @@ next = function next(name) {
116
116
// Tests are run in the order they are defined, so FLUSHDB should always be first.
117
117
118
118
tests . IPV4 = function ( ) {
119
- var ipv4Client = redis . createClient ( PORT , "127.0.0.1" , { "family" : "IPv4" } ) ;
120
-
121
- ipv4Client . once ( "ready" , function start_tests ( ) {
122
- console . log ( "Connected to " + ipv4Client . address + ", Redis server version " + ipv4Client . server_info . redis_version + "\n" ) ;
123
- console . log ( "Using reply parser " + ipv4Client . reply_parser . name ) ;
124
-
125
- ipv4Client . quit ( ) ;
126
- run_next_test ( ) ;
127
- } ) ;
128
-
129
- ipv4Client . on ( 'end' , function ( ) {
130
-
131
- } ) ;
132
-
133
- // Exit immediately on connection failure, which triggers "exit", below, which fails the test
134
- ipv4Client . on ( "error" , function ( err ) {
135
- console . error ( "client: " + err . stack ) ;
136
- process . exit ( ) ;
137
- } ) ;
119
+ var ipv4Client = redis . createClient ( PORT , "127.0.0.1" , { "family" : "IPv4" } ) ;
120
+
121
+ ipv4Client . once ( "ready" , function start_tests ( ) {
122
+ console . log ( "Connected to " + ipv4Client . address + ", Redis server version " + ipv4Client . server_info . redis_version + "\n" ) ;
123
+ console . log ( "Using reply parser " + ipv4Client . reply_parser . name ) ;
124
+
125
+ ipv4Client . quit ( ) ;
126
+ run_next_test ( ) ;
127
+ } ) ;
128
+
129
+ ipv4Client . on ( 'end' , function ( ) {
130
+
131
+ } ) ;
132
+
133
+ // Exit immediately on connection failure, which triggers "exit", below, which fails the test
134
+ ipv4Client . on ( "error" , function ( err ) {
135
+ console . error ( "client: " + err . stack ) ;
136
+ process . exit ( ) ;
137
+ } ) ;
138
138
}
139
139
140
140
tests . IPV6 = function ( ) {
141
- var ipv6Client = redis . createClient ( PORT , "::1" , { "family" : "IPv6" } ) ;
142
-
143
- ipv6Client . once ( "ready" , function start_tests ( ) {
144
- console . log ( "Connected to " + ipv6Client . address + ", Redis server version " + ipv6Client . server_info . redis_version + "\n" ) ;
145
- console . log ( "Using reply parser " + ipv6Client . reply_parser . name ) ;
146
-
147
- ipv6Client . quit ( ) ;
148
- run_next_test ( ) ;
149
- } ) ;
150
-
151
- ipv6Client . on ( 'end' , function ( ) {
152
-
153
- } ) ;
154
-
155
- // Exit immediately on connection failure, which triggers "exit", below, which fails the test
156
- ipv6Client . on ( "error" , function ( err ) {
157
- console . error ( "client: " + err . stack ) ;
158
- process . exit ( ) ;
159
- } ) ;
141
+ if ( ! server_version_at_least ( client , [ 2 , 8 , 0 ] ) ) {
142
+ console . log ( "Skipping IPV6 for old Redis server version < 2.8.0" ) ;
143
+ return run_next_test ( ) ;
144
+ }
145
+ var ipv6Client = redis . createClient ( PORT , "::1" , { "family" : "IPv6" } ) ;
146
+
147
+ ipv6Client . once ( "ready" , function start_tests ( ) {
148
+ console . log ( "Connected to " + ipv6Client . address + ", Redis server version " + ipv6Client . server_info . redis_version + "\n" ) ;
149
+ console . log ( "Using reply parser " + ipv6Client . reply_parser . name ) ;
150
+
151
+ ipv6Client . quit ( ) ;
152
+ run_next_test ( ) ;
153
+ } ) ;
154
+
155
+ ipv6Client . on ( 'end' , function ( ) {
156
+
157
+ } ) ;
158
+
159
+ // Exit immediately on connection failure, which triggers "exit", below, which fails the test
160
+ ipv6Client . on ( "error" , function ( err ) {
161
+ console . error ( "client: " + err . stack ) ;
162
+ process . exit ( ) ;
163
+ } ) ;
160
164
}
161
165
162
166
tests . UNIX_SOCKET = function ( ) {
@@ -635,7 +639,7 @@ tests.CLIENT_LIST = function() {
635
639
return next ( name ) ;
636
640
}
637
641
638
- var pattern = / ^ a d d = / ;
642
+ var pattern = / ^ a d d r = / ;
639
643
if ( server_version_at_least ( client , [ 2 , 8 , 12 ] ) ) {
640
644
pattern = / ^ i d = \d + a d d r = / ;
641
645
}
0 commit comments