TestRefResolverBoundaryRegression verifies that valid boundary indices (0 and len-1) still resolve correctly after the security fix.
(t *testing.T)
| 205 | // TestRefResolverBoundaryRegression verifies that valid boundary indices |
| 206 | // (0 and len-1) still resolve correctly after the security fix. |
| 207 | func TestRefResolverBoundaryRegression(t *testing.T) { |
| 208 | resolver := newRefResolver(true) |
| 209 | val := reflect.ValueOf("test") |
| 210 | |
| 211 | // Fill the resolver with 2 objects |
| 212 | id0, _ := resolver.PreserveRefId() |
| 213 | resolver.SetReadObject(id0, val) |
| 214 | id1, _ := resolver.PreserveRefId() |
| 215 | resolver.SetReadObject(id1, val) |
| 216 | |
| 217 | // Verify boundary indices still work |
| 218 | require.Equal(t, val.String(), resolver.GetReadObject(0).String(), "Should resolve index 0") |
| 219 | require.Equal(t, val.String(), resolver.GetReadObject(1).String(), "Should resolve index len-1") |
| 220 | } |
nothing calls this directly
no test coverage detected