| 1 |
#include "foobar.h" |
| 2 |
|
| 3 |
int x = foo(); |
| 4 |
|
| 5 |
// RUN: clang-include-cleaner -print=changes %s -- -I%S/Inputs/ | FileCheck --check-prefix=CHANGE %s |
| 6 |
// CHANGE: - "foobar.h" |
| 7 |
// CHANGE-NEXT: + "foo.h" |
| 8 |
|
| 9 |
// RUN: clang-include-cleaner -remove=0 -print=changes %s -- -I%S/Inputs/ | FileCheck --check-prefix=INSERT %s |
| 10 |
// INSERT-NOT: - "foobar.h" |
| 11 |
// INSERT: + "foo.h" |
| 12 |
|
| 13 |
// RUN: clang-include-cleaner -insert=0 -print=changes %s -- -I%S/Inputs/ | FileCheck --check-prefix=REMOVE %s |
| 14 |
// REMOVE: - "foobar.h" |
| 15 |
// REMOVE-NOT: + "foo.h" |
| 16 |
|
| 17 |
// RUN: clang-include-cleaner -print %s -- -I%S/Inputs/ | FileCheck --match-full-lines --check-prefix=PRINT %s |
| 18 |
// PRINT: #include "foo.h" |
| 19 |
// PRINT-NOT: {{^}}#include "foobar.h"{{$}} |
| 20 |
|
| 21 |
// RUN: cp %s %t.cpp |
| 22 |
// RUN: clang-include-cleaner -edit %t.cpp -- -I%S/Inputs/ |
| 23 |
// RUN: FileCheck --match-full-lines --check-prefix=EDIT %s < %t.cpp |
| 24 |
// EDIT: #include "foo.h" |
| 25 |
// EDIT-NOT: {{^}}#include "foobar.h"{{$}} |