From 43da3efc054e4ef733a7d5b34dc931f1e3a28728 Mon Sep 17 00:00:00 2001 From: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com> Date: Fri, 16 Oct 2026 12:33:45 -0700 Subject: [PATCH] test: add negative-imaginary complex cases to number_to_string tests Adds the two cases from the original fix that are not covered on dev: - 'e' notation with negative imaginary part (1.0e+0-1.0e+0j) - negative real with negative imaginary part (-1.0-1.0j) The code fix itself is already on dev via #598; this keeps only the extra test coverage. Targets dev, no CHANGELOG edit. --- tests/test_helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_helper.py b/tests/test_helper.py index a42407bd..3035a535 100644 --- a/tests/test_helper.py +++ b/tests/test_helper.py @@ -170,6 +170,8 @@ def test_number_to_string_decimal_digits(self, t1, t2, significant_digits, numbe (-0.00002-0.00002j, 0.00001+0.00001j, 0, "e", True), # negative imaginary parts must round-trip, not raise (issue #551) (1-1j, 2-3j, 1, "f", ('1.0-1.0j', '2.0-3.0j')), + (1-1j, 1.2-1.2j, 1, "e", ('1.0e+0-1.0e+0j', '1.2e+0-1.2e+0j')), + (-1-1j, -1.2-1.2j, 1, "f", ('-1.0-1.0j', '-1.2-1.2j')), (4-10j, 4.0000002-10.0000002j, 5, "f", True), (10j, 10.2j, 5, "f", ('0.00000+10.00000j', '0.00000+10.20000j')), (10j, 10.2j, 5, "e", ('0.00000e+0+1.00000e+1j', '0.00000e+0+1.02000e+1j')),