forked from OSchip/llvm-project
clang-format: [JS] Ensure that formatting actually takes place in tests.
And fix formatting issue discovered by that :-). llvm-svn: 239530
This commit is contained in:
parent
b6b58b3152
commit
56691b8cb9
|
@ -558,7 +558,7 @@ private:
|
||||||
break;
|
break;
|
||||||
case tok::question:
|
case tok::question:
|
||||||
if (Style.Language == FormatStyle::LK_JavaScript && Tok->Next &&
|
if (Style.Language == FormatStyle::LK_JavaScript && Tok->Next &&
|
||||||
Tok->Next->isOneOf(tok::semi, tok::colon, tok::r_paren,
|
Tok->Next->isOneOf(tok::semi, tok::comma, tok::colon, tok::r_paren,
|
||||||
tok::r_brace)) {
|
tok::r_brace)) {
|
||||||
// Question marks before semicolons, colons, etc. indicate optional
|
// Question marks before semicolons, colons, etc. indicate optional
|
||||||
// types (fields, parameters), e.g.
|
// types (fields, parameters), e.g.
|
||||||
|
|
|
@ -24,7 +24,10 @@ protected:
|
||||||
DEBUG(llvm::errs() << "---\n");
|
DEBUG(llvm::errs() << "---\n");
|
||||||
DEBUG(llvm::errs() << Code << "\n\n");
|
DEBUG(llvm::errs() << Code << "\n\n");
|
||||||
std::vector<tooling::Range> Ranges(1, tooling::Range(Offset, Length));
|
std::vector<tooling::Range> Ranges(1, tooling::Range(Offset, Length));
|
||||||
tooling::Replacements Replaces = reformat(Style, Code, Ranges);
|
bool IncompleteFormat = false;
|
||||||
|
tooling::Replacements Replaces =
|
||||||
|
reformat(Style, Code, Ranges, "<stdin>", &IncompleteFormat);
|
||||||
|
EXPECT_FALSE(IncompleteFormat);
|
||||||
std::string Result = applyAllReplacements(Code, Replaces);
|
std::string Result = applyAllReplacements(Code, Replaces);
|
||||||
EXPECT_NE("", Result);
|
EXPECT_NE("", Result);
|
||||||
DEBUG(llvm::errs() << "\n" << Result << "\n\n");
|
DEBUG(llvm::errs() << "\n" << Result << "\n\n");
|
||||||
|
|
Loading…
Reference in New Issue