Merge pull request #6696 from ethereum/sol-yul-while

Fix wrong test settings
This commit is contained in:
chriseth 2019-05-08 12:48:57 +02:00 committed by GitHub
commit ed450a31a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -66,6 +66,7 @@ string TestCase::parseSourceAndSettings(istream& _stream)
{ {
string source; string source;
string line; string line;
static string const comment("// ");
static string const settingsDelimiter("// ===="); static string const settingsDelimiter("// ====");
static string const delimiter("// ----"); static string const delimiter("// ----");
bool sourcePart = true; bool sourcePart = true;
@ -77,12 +78,12 @@ string TestCase::parseSourceAndSettings(istream& _stream)
sourcePart = false; sourcePart = false;
else if (sourcePart) else if (sourcePart)
source += line + "\n"; source += line + "\n";
else if (boost::algorithm::starts_with(line, "// ")) else if (boost::algorithm::starts_with(line, comment))
{ {
size_t colon = line.find(':'); size_t colon = line.find(':');
if (colon == string::npos) if (colon == string::npos)
throw runtime_error(string("Expected \":\" inside setting.")); throw runtime_error(string("Expected \":\" inside setting."));
string key = line.substr(3, colon - 3); string key = line.substr(comment.size(), colon - comment.size());
string value = line.substr(colon + 1); string value = line.substr(colon + 1);
boost::algorithm::trim(key); boost::algorithm::trim(key);
boost::algorithm::trim(value); boost::algorithm::trim(value);

View File

@ -16,7 +16,7 @@ contract C {
function t(uint) public pure { function t(uint) public pure {
} }
} }
// === // ====
// compileViaYul: true // compileViaYul: true
// ---- // ----
// f() -> 0 // f() -> 0

View File

@ -23,7 +23,7 @@ contract C is X {
x = 3; x = 3;
} }
} }
// === // ====
// compileViaYul: true // compileViaYul: true
// ---- // ----
// f() -> 3 // f() -> 3