aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-11-16 01:37:18 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-11-16 01:58:55 +0800
commit227f6aab4f96003e0f7c99194a9ea1095041970f (patch)
tree049fdd9eaf1bbe8ec18ff643739378a076d54e9e /test
parent81c50143f2bff6f589ab1237d68c8820107f18b9 (diff)
downloaddexon-solidity-227f6aab4f96003e0f7c99194a9ea1095041970f.tar
dexon-solidity-227f6aab4f96003e0f7c99194a9ea1095041970f.tar.gz
dexon-solidity-227f6aab4f96003e0f7c99194a9ea1095041970f.tar.bz2
dexon-solidity-227f6aab4f96003e0f7c99194a9ea1095041970f.tar.lz
dexon-solidity-227f6aab4f96003e0f7c99194a9ea1095041970f.tar.xz
dexon-solidity-227f6aab4f96003e0f7c99194a9ea1095041970f.tar.zst
dexon-solidity-227f6aab4f96003e0f7c99194a9ea1095041970f.zip
Change natspec/abi JSON expected message to be the same
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityABIJSON.cpp4
-rw-r--r--test/libsolidity/SolidityNatspecJSON.cpp7
2 files changed, 6 insertions, 5 deletions
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp
index 0566f253..0ad9e928 100644
--- a/test/libsolidity/SolidityABIJSON.cpp
+++ b/test/libsolidity/SolidityABIJSON.cpp
@@ -40,12 +40,14 @@ public:
void checkInterface(std::string const& _code, std::string const& _expectedInterfaceString)
{
ETH_TEST_REQUIRE_NO_THROW(m_compilerStack.parse("pragma solidity >=0.0;\n" + _code), "Parsing contract failed");
+
Json::Value generatedInterface = m_compilerStack.metadata("", DocumentationType::ABIInterface);
Json::Value expectedInterface;
m_reader.parse(_expectedInterfaceString, expectedInterface);
BOOST_CHECK_MESSAGE(
expectedInterface == generatedInterface,
- "Expected:\n" << expectedInterface.toStyledString() << "\n but got:\n" << generatedInterface.toStyledString()
+ "Expected:\n" << expectedInterface.toStyledString() <<
+ "\n but got:\n" << generatedInterface.toStyledString()
);
}
diff --git a/test/libsolidity/SolidityNatspecJSON.cpp b/test/libsolidity/SolidityNatspecJSON.cpp
index f05542b1..49844f15 100644
--- a/test/libsolidity/SolidityNatspecJSON.cpp
+++ b/test/libsolidity/SolidityNatspecJSON.cpp
@@ -26,7 +26,6 @@
#include <libsolidity/interface/CompilerStack.h>
#include <libsolidity/interface/Exceptions.h>
#include <libdevcore/Exceptions.h>
-#include <libdevcore/JSON.h>
namespace dev
{
@@ -46,9 +45,9 @@ public:
bool _userDocumentation
)
{
- Json::Value generatedDocumentation;
ETH_TEST_REQUIRE_NO_THROW(m_compilerStack.parse("pragma solidity >=0.0;\n" + _code), "Parsing failed");
+ Json::Value generatedDocumentation;
if (_userDocumentation)
generatedDocumentation = m_compilerStack.metadata("", DocumentationType::NatspecUser);
else
@@ -57,8 +56,8 @@ public:
m_reader.parse(_expectedDocumentationString, expectedDocumentation);
BOOST_CHECK_MESSAGE(
expectedDocumentation == generatedDocumentation,
- "Expected " << _expectedDocumentationString <<
- "\n but got:\n" << dev::jsonPrettyPrint(generatedDocumentation)
+ "Expected " << expectedDocumentation.toStyledString() <<
+ "\n but got:\n" << generatedDocumentation.toStyledString()
);
}