@@ -150,4 +150,48 @@ public void SingleResultConvertibleDirectViaChangeType_TypeCode()
150150 Assert . StrictEqual ( 123f , Convert . ChangeType ( value , TypeCode . Single ) ) ;
151151 Assert . StrictEqual ( 123d , Convert . ChangeType ( value , TypeCode . Double ) ) ;
152152 }
153+
154+ [ Theory ]
155+ [ InlineData ( ResultType . Double ) ]
156+ [ InlineData ( ResultType . BulkString ) ]
157+ [ InlineData ( ResultType . SimpleString ) ]
158+ public void RedisResultParseNaN ( ResultType resultType )
159+ {
160+ // https://github.com/redis/NRedisStack/issues/439
161+ var value = RedisResult . Create ( "NaN" , resultType ) ;
162+ Assert . True ( double . IsNaN ( value . AsDouble ( ) ) ) ;
163+ }
164+
165+ [ Theory ]
166+ [ InlineData ( ResultType . Double ) ]
167+ [ InlineData ( ResultType . BulkString ) ]
168+ [ InlineData ( ResultType . SimpleString ) ]
169+ public void RedisResultParseInf ( ResultType resultType )
170+ {
171+ // https://github.com/redis/NRedisStack/issues/439
172+ var value = RedisResult . Create ( "inf" , resultType ) ;
173+ Assert . True ( double . IsPositiveInfinity ( value . AsDouble ( ) ) ) ;
174+ }
175+
176+ [ Theory ]
177+ [ InlineData ( ResultType . Double ) ]
178+ [ InlineData ( ResultType . BulkString ) ]
179+ [ InlineData ( ResultType . SimpleString ) ]
180+ public void RedisResultParsePlusInf ( ResultType resultType )
181+ {
182+ // https://github.com/redis/NRedisStack/issues/439
183+ var value = RedisResult . Create ( "+inf" , resultType ) ;
184+ Assert . True ( double . IsPositiveInfinity ( value . AsDouble ( ) ) ) ;
185+ }
186+
187+ [ Theory ]
188+ [ InlineData ( ResultType . Double ) ]
189+ [ InlineData ( ResultType . BulkString ) ]
190+ [ InlineData ( ResultType . SimpleString ) ]
191+ public void RedisResultParseMinusInf ( ResultType resultType )
192+ {
193+ // https://github.com/redis/NRedisStack/issues/439
194+ var value = RedisResult . Create ( "-inf" , resultType ) ;
195+ Assert . True ( double . IsNegativeInfinity ( value . AsDouble ( ) ) ) ;
196+ }
153197}
0 commit comments