clang-format: Restructure and add missing tests.

Patch by Jean-Philippe Dufraigne, Thank you!