@@ -747,20 +747,6 @@ def test_empty_bytes_raises_error(self):
747747 with pytest .raises (ValueError ):
748748 bytes_array .astype (QuadPrecDType ())
749749
750- # Tests for all string types (fixed-length Unicode and variable-length StringDType)
751- @pytest .mark .parametrize ("strtype" , [np .str_ , np .dtypes .StringDType ()])
752- def test_negative_zero_roundtrip (self , strtype ):
753- """Test that negative zero sign is preserved through string roundtrip"""
754- neg_zero = QuadPrecision ("-0.0" )
755- quad_array = np .array ([neg_zero ], dtype = QuadPrecDType ())
756- assert np .signbit (quad_array [0 ]), "Input should have negative zero signbit"
757-
758- str_array = quad_array .astype (strtype )
759- assert str_array [0 ] == "-0.0" , f"Expected '-0.0', got '{ str_array [0 ]} '"
760-
761- roundtrip = str_array .astype (QuadPrecDType ())
762- assert np .signbit (roundtrip [0 ]), "Signbit should be preserved after round-trip"
763-
764750 @pytest .mark .parametrize ("strtype" , [np .str_ , np .dtypes .StringDType ()])
765751 @pytest .mark .parametrize ("backend" , ["sleef" , "longdouble" ])
766752 def test_string_backend_consistency (self , strtype , backend ):
@@ -865,9 +851,10 @@ def test_nan_case_insensitive(self, input_str, strtype):
865851 ("+1.23e-45" , 1.23e-45 ),
866852 ("-1.23e-45" , - 1.23e-45 ),
867853 ])
868- def test_numeric_sign_handling (self , input_str , expected_val ):
854+ @pytest .mark .parametrize ("strtype" , ['U20' , np .dtypes .StringDType ()])
855+ def test_numeric_sign_handling (self , input_str , expected_val , strtype ):
869856 """Test that +/- signs are correctly handled for numeric values"""
870- arr = np .array ([input_str ], dtype = 'U20' )
857+ arr = np .array ([input_str ], dtype = strtype )
871858 result = arr .astype (QuadPrecDType ())
872859
873860 result_val = float (str (result [0 ]))
0 commit comments