mirror of
https://github.com/MaskRay/ccls.git
synced 2025-04-02 15:02:19 +00:00
Add assert when updating test expectations
This commit is contained in:
parent
4efb4dbf25
commit
9ffed9a253
@ -1,9 +1,9 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <locale>
|
#include <locale>
|
||||||
@ -244,6 +244,7 @@ void UpdateTestExpectation(const std::string& filename, const std::string& expec
|
|||||||
|
|
||||||
// Replace expectation
|
// Replace expectation
|
||||||
auto it = str.find(expectation);
|
auto it = str.find(expectation);
|
||||||
|
assert(it != std::string::npos);
|
||||||
str.replace(it, expectation.size(), actual);
|
str.replace(it, expectation.size(), actual);
|
||||||
|
|
||||||
// Write it back out.
|
// Write it back out.
|
||||||
|
Loading…
Reference in New Issue
Block a user