mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
fixed natspec evaluator result on error
This commit is contained in:
parent
d3dd2972c1
commit
1954c0686d
15
natspec.cpp
15
natspec.cpp
@ -62,7 +62,6 @@ BOOST_AUTO_TEST_CASE(natspec_create_custom_function)
|
||||
// given
|
||||
NatspecExpressionEvaluator e;
|
||||
|
||||
|
||||
// when
|
||||
auto x = e.evalExpression("`test = function (x) { return x + 'ok'; }`"); // ommit var, make it global
|
||||
string result = e.evalExpression("`test(5)`").toStdString();
|
||||
@ -121,4 +120,18 @@ BOOST_AUTO_TEST_CASE(natspec_js_eval_input_params)
|
||||
BOOST_CHECK_EQUAL(result, "Will multiply 4 by 7 and return 28.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(natspec_js_eval_error)
|
||||
{
|
||||
cnote << "testing natspec evaluation of incorrect input";
|
||||
|
||||
// given
|
||||
NatspecExpressionEvaluator e;
|
||||
|
||||
// when
|
||||
string result = e.evalExpression("`test(`").toStdString();
|
||||
|
||||
// then
|
||||
BOOST_CHECK_EQUAL(result, "`test(`");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
Loading…
Reference in New Issue
Block a user