@@ -77,9 +77,9 @@ func TestFixJSONNumberTypes(t *testing.T) {
7777 assert .True (t , ok , "Result should be a map" )
7878
7979 // Check that the values were converted to float64
80- assert .Equal (t , float64 (19.99 ), mapResult ["price" ])
81- assert .Equal (t , float64 (4.5 ), mapResult ["rating" ])
82- assert .Equal (t , float64 (75.5 ), mapResult ["percentage" ])
80+ assert .InDelta (t , float64 (19.99 ), mapResult ["price" ], 0.0001 )
81+ assert .InDelta (t , float64 (4.5 ), mapResult ["rating" ], 0.0001 )
82+ assert .InDelta (t , float64 (75.5 ), mapResult ["percentage" ], 0.0001 )
8383 assert .IsType (t , float64 (0 ), mapResult ["price" ])
8484 assert .IsType (t , float64 (0 ), mapResult ["rating" ])
8585 assert .IsType (t , float64 (0 ), mapResult ["percentage" ])
@@ -113,7 +113,7 @@ func TestFixJSONNumberTypes(t *testing.T) {
113113 stats , ok := user ["stats" ].(map [string ]any )
114114 assert .True (t , ok , "stats should be a map" )
115115 assert .Equal (t , int (42 ), stats ["login_count" ])
116- assert .Equal (t , float64 (95.5 ), stats ["score" ])
116+ assert .InDelta (t , float64 (95.5 ), stats ["score" ], 0.0001 )
117117 })
118118
119119 t .Run ("handles slices" , func (t * testing.T ) {
@@ -142,7 +142,7 @@ func TestFixJSONNumberTypes(t *testing.T) {
142142 itemMap , ok := sliceResult [3 ].(map [string ]any )
143143 assert .True (t , ok , "Item at index 3 should be a map" )
144144 assert .Equal (t , int (123 ), itemMap ["item_id" ])
145- assert .Equal (t , float64 (9.99 ), itemMap ["price" ])
145+ assert .InDelta (t , float64 (9.99 ), itemMap ["price" ], 0.0001 )
146146 })
147147
148148 t .Run ("handles nested slices" , func (t * testing.T ) {
@@ -177,13 +177,13 @@ func TestFixJSONNumberTypes(t *testing.T) {
177177 product1 , ok := products [0 ].(map [string ]any )
178178 assert .True (t , ok , "First product should be a map" )
179179 assert .Equal (t , int (1 ), product1 ["product_id" ])
180- assert .Equal (t , float64 (19.99 ), product1 ["price" ])
180+ assert .InDelta (t , float64 (19.99 ), product1 ["price" ], 0.0001 )
181181
182182 // Check second product
183183 product2 , ok := products [1 ].(map [string ]any )
184184 assert .True (t , ok , "Second product should be a map" )
185185 assert .Equal (t , int (2 ), product2 ["product_id" ])
186- assert .Equal (t , float64 (29.99 ), product2 ["price" ])
186+ assert .InDelta (t , float64 (29.99 ), product2 ["price" ], 0.0001 )
187187 })
188188
189189 t .Run ("handles invalid numbers gracefully" , func (t * testing.T ) {
0 commit comments