undo_patch.RdUndo a previously injected patch
undo_patch(pkg, names = NULL)Invisibly TRUE on success.
# First inject a patch
inject_patch(
pkg = "hotpatchR",
patch_list = list(dummy_child_func = function(x) {
paste("I am PATCHED! Input:", x)
})
)
# Call with patched function
patched <- dummy_parent_func("test")
print(patched)
#> [1] "Parent output -> I am PATCHED! Input: test"
# Restore the original function
undo_patch(pkg = "hotpatchR", names = "dummy_child_func")
# Now it's back to the original
restored <- dummy_parent_func("test")
print(restored)
#> [1] "Parent output -> I am the BROKEN child. Input: test"