Improve test coverage for testing AST

This commit is contained in:
Dmitry-Me 2019-11-28 18:11:55 +03:00
parent fd900ab8b2
commit ff36ebcff2
1 changed files with 4 additions and 0 deletions

View File

@ -129,6 +129,10 @@ private:
ASSERT_EQUALS(true, isReturnScope("auto f() { return [=]() { return data; }; }", -1));
ASSERT_EQUALS(true, isReturnScope("auto f() { return [=]() { return data; }(); }", -1));
ASSERT_EQUALS(false, isReturnScope("auto f() { [=]() { return data; }(); }", -1));
ASSERT_EQUALS(true, isReturnScope("void negativeTokenOffset() { return; }", -1));
ASSERT_EQUALS(false, isReturnScope("void zeroTokenOffset() { return; }", 0));
ASSERT_EQUALS(true, isReturnScope("void positiveTokenOffset() { return; }", 7));
}
bool isVariableChanged(const char code[], const char startPattern[], const char endPattern[]) {