From c31731d0131c08c4ced091449764561eb3e5e2ab Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 17 Feb 2015 19:02:20 +0100 Subject: Added `Section` test case * as its name implies `Section` enables the extraction of a section of a given list ** a section is defined by its start and end index --- test.cc | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/test.cc b/test.cc index 6560795..2f95561 100644 --- a/test.cc +++ b/test.cc @@ -359,6 +359,44 @@ static_assert( "(list 1 2) != (cons 1 (cons 2 void))" ); +// list section + +static_assert( + std::is_same< + tav::List>, + tav::Section< + tav::Size<1>, + tav::Size<1>, + tav::List, tav::Int<2>, tav::Int<3>> + > + >::value, + "(section 1 1 (list 1 2 3)) != (list 1)" +); + +static_assert( + std::is_same< + tav::List, tav::Int<3>>, + tav::Section< + tav::Size<1>, + tav::Size<2>, + tav::List, tav::Int<2>, tav::Int<3>> + > + >::value, + "(section 1 2 (list 1 2 3)) != (list 1 2)" +); + +static_assert( + std::is_same< + tav::List, tav::Int<2>, tav::Int<3>>, + tav::Section< + tav::Size<0>, + tav::Size<2>, + tav::List, tav::Int<2>, tav::Int<3>> + > + >::value, + "(section 0 2 (list 1 2 3)) != (list 1 2 3)" +); + // list take static_assert( -- cgit v1.2.3