Add __test experimental mode for testing

This commit is contained in:
Alex Beregszaszi 2017-08-10 17:09:44 +01:00
parent a7a9ed4718
commit 644c91fc2d
2 changed files with 13 additions and 9 deletions

View File

@ -27,9 +27,13 @@ namespace dev
namespace solidity
{
enum class ExperimentalFeature {};
enum class ExperimentalFeature {
Test
};
static const std::map<std::string, ExperimentalFeature> ExperimentalFeatureNames = {};
static const std::map<std::string, ExperimentalFeature> ExperimentalFeatureNames = {
{ "__test", ExperimentalFeature::Test },
};
}
}

View File

@ -6584,15 +6584,15 @@ BOOST_AUTO_TEST_CASE(experimental_pragma)
pragma experimental unsupportedName unsupportedName;
)";
CHECK_ERROR(text, SyntaxError, "Stray arguments.");
text = R"(
pragma experimental __test;
)";
CHECK_WARNING(text, "Experimental features are turned on. Do not use experimental features on live deployments.");
// text = R"(
// pragma experimental supportedName;
// pragma experimental __test;
// pragma experimental __test;
// )";
// CHECK_WARNING(text, "Experimental features are turned on. Do not use experimental features on live deployments.");
// text = R"(
// pragma experimental supportedName;
// pragma experimental supportedName;
// )";
// CHECK_ERROR(text, SyntaxError, "Duplicate experimental feature name.");
// CHECK_ERROR_ALLOW_MULTI(text, SyntaxError, "Duplicate experimental feature name.");
}
BOOST_AUTO_TEST_SUITE_END()