diff options
Diffstat (limited to 'clang/unittests/Format/SortImportsTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/SortImportsTestJS.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/unittests/Format/SortImportsTestJS.cpp b/clang/unittests/Format/SortImportsTestJS.cpp index e6b5273f7b1..77c37e337dd 100644 --- a/clang/unittests/Format/SortImportsTestJS.cpp +++ b/clang/unittests/Format/SortImportsTestJS.cpp @@ -25,10 +25,13 @@ protected: if (Length == 0U) Length = Code.size() - Offset; std::vector<tooling::Range> Ranges(1, tooling::Range(Offset, Length)); - std::string Sorted = + auto Sorted = applyAllReplacements(Code, sortIncludes(Style, Code, Ranges, FileName)); - return applyAllReplacements(Sorted, - reformat(Style, Sorted, Ranges, FileName)); + EXPECT_TRUE(static_cast<bool>(Sorted)); + auto Formatted = applyAllReplacements( + *Sorted, reformat(Style, *Sorted, Ranges, FileName)); + EXPECT_TRUE(static_cast<bool>(Formatted)); + return *Formatted; } void verifySort(llvm::StringRef Expected, llvm::StringRef Code, |