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-03-17 17:59:30 +11:00
|
|
|
tap.expect_eq (s, util::make_view(s), "string/view equality");
|
|
|
|
tap.expect_neq (s, util::make_view(t), "string/view inequality");
|
|
|
|
tap.expect_eq (s.data (), util::make_view (s), "c-str/view equality");
|
|
|
|
tap.expect_eq (s, util::view<const char*> (&*s.cbegin (), &*s.cend ()), "string/pointer-view equality");
|
2016-03-17 18:12:34 +11:00
|
|
|
|
|
|
|
return tap.status ();
|
|
|
|
}
|