-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Infrastructure for extracting syntax tests. #3707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Still to be discussed:
|
cfb1fc3
to
72b815d
Compare
72b815d
to
3232561
Compare
test/libsolidity/SyntaxTest.cpp
Outdated
m_errorList = parseAnalyseAndReturnError(m_source, true, true, true).second; | ||
if (!matchesExpectations(m_errorList)) | ||
{ | ||
std::string nextIndentLevel = _indent.empty() ? "\t" : _indent + _indent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you double the indentation instead of just adding a \t
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the interactive tool isoltest
later I use two spaces instead of tabs as indentation - that was the reason, but I agree: doubling the indentation does not really make sense in any case, since passing the indent as argument suggests that it could already be deeper than one level; I'll change it to just add a tab here and think about how to do things in isoltest
later.
test/libsolidity/SyntaxTest.cpp
Outdated
{ | ||
ifstream file(_filename); | ||
if (!file) | ||
BOOST_THROW_EXCEPTION(runtime_error("cannot open test contract: \"" + _filename + "\"")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize cannot
?
test/libsolidity/SyntaxTest.cpp
Outdated
else | ||
for (size_t i = 0; i < _errorList.size(); i++) | ||
if ( | ||
!(_errorList[i]->typeName() == m_expectations[i].type) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say !=
is easier to read than !( ... == ...)
@chriseth Requested changes are ready. |
Refs #3644.
Copies some example test contracts from SolidityNameAndTypeResolution.cpp in separate files in test/libsolidity/syntaxTests/ in which the test expectations are encoded in comments, adds a parser for this encoding and populates the boost test tree with these tests.
Part 1 of #3674.