File: check_doctest_string.cpp

package info (click to toggle)
doctest 2.4.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,436 kB
  • sloc: cpp: 13,546; python: 261; makefile: 30; sh: 1
file content (10 lines) | stat: -rw-r--r-- 299 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
#include <doctest/doctest.h>

TEST_SUITE("doctest unit tests") {
    TEST_CASE("doctest::String::substr()") {
        const doctest::String abcde = "abcde";
        CHECK(abcde.substr(0, 3) == "abc");
        CHECK(abcde.substr(2, 3) == "cde");
        CHECK(abcde.substr(0, 5) == "abcde");
    }
}