()
| 1484 | |
| 1485 | #[test] |
| 1486 | fn test_string_roundtrip() { |
| 1487 | let roundtrip_cases = [ |
| 1488 | i256::ZERO, |
| 1489 | i256::ONE, |
| 1490 | i256::MINUS_ONE, |
| 1491 | i256::from_i128(123456789), |
| 1492 | i256::from_i128(-123456789), |
| 1493 | i256::from_i128(i128::MIN), |
| 1494 | i256::from_i128(i128::MAX), |
| 1495 | i256::MIN, |
| 1496 | i256::MAX, |
| 1497 | ]; |
| 1498 | for case in roundtrip_cases { |
| 1499 | let formatted = case.to_string(); |
| 1500 | let back: i256 = formatted.parse().unwrap(); |
| 1501 | assert_eq!(case, back); |
| 1502 | } |
| 1503 | } |
| 1504 | |
| 1505 | #[test] |
| 1506 | fn test_from_string() { |