MCPcopy Create free account
hub / github.com/boostorg/json / testErase

Method testErase

test/string.cpp:1735–1818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1733 }
1734
1735 void
1736 testErase()
1737 {
1738 test_vectors const t;
1739
1740 // erase(size_type, size_type)
1741 {
1742 {
1743 string s(t.v1);
1744 s.erase(1, 3);
1745 BOOST_TEST(s ==
1746 std::string(t.v1).erase(1, 3));
1747 }
1748
1749 {
1750 string s(t.v2);
1751 s.erase(1, 3);
1752 BOOST_TEST(s ==
1753 std::string(t.v2).erase(1, 3));
1754 }
1755
1756 {
1757 string s(t.v1);
1758 s.erase(3);
1759 BOOST_TEST(s ==
1760 std::string(t.v1).erase(3));
1761 }
1762
1763 {
1764 string s(t.v2);
1765 s.erase(3);
1766 BOOST_TEST(s ==
1767 std::string(t.v2).erase(3));
1768 }
1769
1770 {
1771 string s(t.v1);
1772 s.erase();
1773 BOOST_TEST(s ==
1774 std::string(t.v1).erase());
1775 }
1776
1777 {
1778 string s(t.v2);
1779 s.erase();
1780 BOOST_TEST(s ==
1781 std::string(t.v2).erase());
1782 }
1783
1784 {
1785 string s(t.v1);
1786 BOOST_TEST_THROWS_WITH_LOCATION(
1787 (s.erase(t.v1.size() + 1, 1)));
1788 }
1789 }
1790
1791 // iterator erase(const_iterator)
1792 {

Callers

nothing calls this directly

Calls 3

stringClass · 0.50
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected