[all-commits] [llvm/llvm-project] 20b4df: [clang-format][NFC] Clean up unit tests

Owen via All-commits all-commits at lists.llvm.org
Fri Jun 16 16:03:35 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 20b4df1ed611517d2c964dbade3e61aff4be2e87
      https://github.com/llvm/llvm-project/commit/20b4df1ed611517d2c964dbade3e61aff4be2e87
  Author: Owen Pan <owenpiano at gmail.com>
  Date:   2023-06-16 (Fri, 16 Jun 2023)

  Changed paths:
    M clang/unittests/Format/FormatTest.cpp
    M clang/unittests/Format/FormatTestBase.h
    M clang/unittests/Format/FormatTestComments.cpp
    M clang/unittests/Format/FormatTestJS.cpp
    M clang/unittests/Format/FormatTestJava.cpp
    M clang/unittests/Format/QualifierFixerTest.cpp

  Log Message:
  -----------
  [clang-format][NFC] Clean up unit tests

This patch adds a verifyNoChange macro to verify code that won't
change after being formatted. (The code will not be messed up before
being formatted.) It then replaces EXPECT_EQ with verifyFormat
wherever applicable so that the code will be messed up before being
formatted. When the replacement fails the unit test, verifyFormat is
replaced with verifyNoChange.

Differential Revision: https://reviews.llvm.org/D153109




More information about the All-commits mailing list