Partial backport of core PR14954 (commit fa0e65b):
https://github.com/bitcoin/bitcoin/pull/14954/commits/fa0e65b77264476c61832542ab1a9dbedcc738ea#diff-a43dbc1d8db3be80406ee42e2142d7f0
Original scripted-diff:
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test) -END VERIFY SCRIPT-