25 lines · cpp
1/// Check that the ForEachMacros, etc. config entries replace default values instead of appending2/// FIXME: clang-format currently start overriding at index 0 (keeping the remaining3/// values) instead of either appending or completely replacing the values.4/// This behaviour is highly confusing. For now this test documents the current state.5// RUN: clang-format -style="{BasedOnStyle: LLVM}" -dump-config %s | \6// RUN: FileCheck %s --check-prefixes=CHECK,DEFAULT7// RUN: clang-format -style="{BasedOnStyle: LLVM, ForEachMacros: ['OVERRIDE_FOREACH']}" -dump-config %s | \8// RUN: FileCheck %s --check-prefixes=CHECK,OVERRIDE,FIXME-SHOULD-NOT-BE9// RUN: clang-format -style="{BasedOnStyle: LLVM, ForEachMacros: ['M1', 'M2', 'M3', 'M4']}" -dump-config %s | \10// RUN: FileCheck %s --check-prefixes=CHECK,MORE-ENTRIES-THAN-DEFAULT11 12 13// CHECK-LABEL: ForEachMacros:14// DEFAULT-NEXT: {{^ }}- foreach15// DEFAULT-NEXT: {{^ }}- Q_FOREACH16// DEFAULT-NEXT: {{^ }}- BOOST_FOREACH17// OVERRIDE-NEXT: {{^ }}- OVERRIDE_FOREACH18// FIXME-SHOULD-NOT-BE-NEXT: {{^ }}- Q_FOREACH19// FIXME-SHOULD-NOT-BE-NEXT: {{^ }}- BOOST_FOREACH20// MORE-ENTRIES-THAN-DEFAULT-NEXT: {{^ }}- M121// MORE-ENTRIES-THAN-DEFAULT-NEXT: {{^ }}- M222// MORE-ENTRIES-THAN-DEFAULT-NEXT: {{^ }}- M323// MORE-ENTRIES-THAN-DEFAULT-NEXT: {{^ }}- M424// CHECK-NEXT: {{^[F-Z]}}25