mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-01-08 05:00:13 -05:00
Due to these tests happening in the wrong order, removing an object from the end of a sequence of objects would previously cause a bounds-check panic. Rather than a more severe rework of the logic here, for now we'll just introduce an extra precondition to prevent the panic. The code that follows already handles the case where there _is_ no new object (i.e. the "old" object is being deleted) as long as we're able to pass through this type-checking logic. The new "JSON list of objects - removing item" test covers this problem by rendering a diff for an object being removed from the end of a list of objects within a JSON value.