Convert all 'def test' formulae to 'test do' - per #26942

This modifies all `def test` blocks in formulae to use the `test do` syntax. It preserves spacing for those lines.

Changes to the rancid formula are not included in this PR per #26945 - that formula has spacing issues so I wanted to fix it separately.