libcruft-util/test/comparator.cpp
Danny Robson f6056153e3 rename root namespace from util to cruft
This places, at long last, the core library code into the same namespace
as the extended library code.
2018-08-05 14:42:02 +10:00

29 lines
636 B
C++

#include "tap.hpp"
#include "types/comparator.hpp"
int
main (int, char**)
{
cruft::TAP::logger tap;
const auto a = { 1, 2, 3 };
const auto b = { 1, 2, 4 };
tap.expect (
cruft::comparator::indexed<decltype(a)> ()(a, b),
"compare initializer_list as a coordinate, success"
);
tap.expect (
!cruft::comparator::indexed<decltype(a)> ()(b, a),
"compare initializer_list as a coordinate, failure"
);
tap.expect (
!cruft::comparator::indexed<decltype (a)> ()(a, a),
"self compare initializer_list as a coordinate, failure"
);
return tap.status ();
}