Added support for infinite and nan floats/doubles (#215)
- Added support for the custom double values from the protobuf json spec: "Infinity", "-Infinity", and "NaN" - Added `infinite_floats` test data - Updated Message.__eq__ to consider nan values equal - Updated `test_message_json` and `test_binary_compatibility` to replace NaN float values in dictionaries before comparison (because two NaN values are not equal)
This commit is contained in:
		
							
								
								
									
										9
									
								
								tests/inputs/float/float.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								tests/inputs/float/float.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| { | ||||
|     "positive": "Infinity", | ||||
|     "negative": "-Infinity", | ||||
|     "nan": "NaN", | ||||
|     "three": 3.0, | ||||
|     "threePointOneFour": 3.14, | ||||
|     "negThree": -3.0, | ||||
|     "negThreePointOneFour": -3.14 | ||||
|   } | ||||
		Reference in New Issue
	
	Block a user