@@ -115,6 +115,51 @@ next = function next(name) {
115
115
116
116
// Tests are run in the order they are defined, so FLUSHDB should always be first.
117
117
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 . host + ":" + ipv4Client . port + ", 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
+ }
139
+
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 . host + ":" + ipv6Client . port + ", 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
+ } ) ;
160
+ }
161
+
162
+
118
163
tests . FLUSHDB = function ( ) {
119
164
var name = "FLUSHDB" ;
120
165
client . select ( test_db_num , require_string ( "OK" , name ) ) ;
0 commit comments