2016-04-05 11:06:01 +10:00
|
|
|
#include "tap.hpp"
|
|
|
|
#include "view.hpp"
|
2016-03-17 18:12:34 +11:00
|
|
|
|
|
|
|
int
|
|
|
|
main (int, char**)
|
|
|
|
{
|
|
|
|
util::TAP::logger tap;
|
|
|
|
|
|
|
|
const std::string s = "this is a test string";
|
|
|
|
const std::string t = "not the same string";
|
|
|
|
|
2017-09-15 15:22:51 +10:00
|
|
|
tap.expect (equal (s, util::make_view(s)), "string/view equality");
|
|
|
|
tap.expect (!equal (s, util::make_view(t)), "string/view inequality");
|
|
|
|
tap.expect (equal (s.data (), util::make_view (s)), "c-str/view equality");
|
|
|
|
tap.expect (equal (s, util::view<const char*> (&*s.cbegin (), &*s.cend ())), "string/pointer-view equality");
|
2016-03-17 18:12:34 +11:00
|
|
|
|
|
|
|
return tap.status ();
|
|
|
|
}
|