diff options
Diffstat (limited to 'test/liblangutil/SourceLocation.cpp')
-rw-r--r-- | test/liblangutil/SourceLocation.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/liblangutil/SourceLocation.cpp b/test/liblangutil/SourceLocation.cpp index ac7a2173..ef4103da 100644 --- a/test/liblangutil/SourceLocation.cpp +++ b/test/liblangutil/SourceLocation.cpp @@ -33,12 +33,16 @@ BOOST_AUTO_TEST_SUITE(SourceLocationTest) BOOST_AUTO_TEST_CASE(test_fail) { + 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, std::make_shared<std::string>("sourceA")) != SourceLocation(0, 3, std::make_shared<std::string>("sourceB"))); - BOOST_CHECK(SourceLocation(0, 3, std::make_shared<std::string>("source")) == SourceLocation(0, 3, std::make_shared<std::string>("source"))); - BOOST_CHECK(SourceLocation(3, 7, std::make_shared<std::string>("source")).contains(SourceLocation(4, 6, std::make_shared<std::string>("source")))); - BOOST_CHECK(!SourceLocation(3, 7, std::make_shared<std::string>("sourceA")).contains(SourceLocation(4, 6, std::make_shared<std::string>("sourceB")))); - BOOST_CHECK(SourceLocation(3, 7, std::make_shared<std::string>("sourceA")) < SourceLocation(4, 6, std::make_shared<std::string>("sourceB"))); + BOOST_CHECK(SourceLocation(0, 3, sourceA) != SourceLocation(0, 3, sourceB)); + BOOST_CHECK(SourceLocation(0, 3, source) == SourceLocation(0, 3, source)); + BOOST_CHECK(SourceLocation(3, 7, source).contains(SourceLocation(4, 6, source))); + BOOST_CHECK(!SourceLocation(3, 7, sourceA).contains(SourceLocation(4, 6, sourceB))); + BOOST_CHECK(SourceLocation(3, 7, sourceA) < SourceLocation(4, 6, sourceB)); } BOOST_AUTO_TEST_SUITE_END() |