From 9ffed9a2539550539fd219a5273d3355cfd55784 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Mon, 8 May 2017 18:21:21 -0700 Subject: [PATCH] Add assert when updating test expectations --- src/utils.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.cc b/src/utils.cc index eae689d0..e5dd420c 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -1,9 +1,9 @@ #include "utils.h" -#include +#include #include #include -#include +#include #include #include #include @@ -244,6 +244,7 @@ void UpdateTestExpectation(const std::string& filename, const std::string& expec // Replace expectation auto it = str.find(expectation); + assert(it != std::string::npos); str.replace(it, expectation.size(), actual); // Write it back out.