mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Modified SourceLocation::hasText() to allow empty source.
This commit is contained in:
@@ -51,11 +51,11 @@ BOOST_AUTO_TEST_SUITE(Assembler)
|
||||
BOOST_AUTO_TEST_CASE(all_assembly_items)
|
||||
{
|
||||
Assembly _assembly;
|
||||
auto root_asm = make_shared<CharStream>("lorem ipsum", "root.asm");
|
||||
auto root_asm = make_shared<CharStream>("", "root.asm");
|
||||
_assembly.setSourceLocation({1, 3, root_asm});
|
||||
|
||||
Assembly _subAsm;
|
||||
auto sub_asm = make_shared<CharStream>("lorem ipsum", "sub.asm");
|
||||
auto sub_asm = make_shared<CharStream>("", "sub.asm");
|
||||
_subAsm.setSourceLocation({6, 8, sub_asm});
|
||||
_subAsm.append(Instruction::INVALID);
|
||||
shared_ptr<Assembly> _subAsmPtr = make_shared<Assembly>(_subAsm);
|
||||
|
||||
@@ -33,9 +33,9 @@ BOOST_AUTO_TEST_SUITE(SourceLocationTest)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_fail)
|
||||
{
|
||||
auto const source = std::make_shared<CharStream>("lorem ipsum", "source");
|
||||
auto const sourceA = std::make_shared<CharStream>("lorem ipsum", "sourceA");
|
||||
auto const sourceB = std::make_shared<CharStream>("lorem ipsum", "sourceB");
|
||||
auto const source = std::make_shared<CharStream>("", "source");
|
||||
auto const sourceA = std::make_shared<CharStream>("", "sourceA");
|
||||
auto const sourceB = std::make_shared<CharStream>("", "sourceB");
|
||||
|
||||
BOOST_CHECK(SourceLocation{} == SourceLocation{});
|
||||
BOOST_CHECK((SourceLocation{0, 3, sourceA} != SourceLocation{0, 3, sourceB}));
|
||||
|
||||
Reference in New Issue
Block a user