diff options
author | Adrian Kummerlaender | 2015-02-17 19:02:20 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2015-02-17 19:02:20 +0100 |
commit | c31731d0131c08c4ced091449764561eb3e5e2ab (patch) | |
tree | 377c14708a6ccf91942de5e0a17fade1935e88e7 | |
parent | 8e4e3466694e5bef43f1308296a76086a7db453d (diff) | |
download | TypeAsValue-c31731d0131c08c4ced091449764561eb3e5e2ab.tar TypeAsValue-c31731d0131c08c4ced091449764561eb3e5e2ab.tar.gz TypeAsValue-c31731d0131c08c4ced091449764561eb3e5e2ab.tar.bz2 TypeAsValue-c31731d0131c08c4ced091449764561eb3e5e2ab.tar.lz TypeAsValue-c31731d0131c08c4ced091449764561eb3e5e2ab.tar.xz TypeAsValue-c31731d0131c08c4ced091449764561eb3e5e2ab.tar.zst TypeAsValue-c31731d0131c08c4ced091449764561eb3e5e2ab.zip |
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
-rw-r--r-- | test.cc | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -359,6 +359,44 @@ static_assert( "(list 1 2) != (cons 1 (cons 2 void))" ); +// list section + +static_assert( + std::is_same< + tav::List<tav::Int<2>>, + tav::Section< + tav::Size<1>, + tav::Size<1>, + tav::List<tav::Int<1>, 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<2>, tav::Int<3>>, + tav::Section< + tav::Size<1>, + tav::Size<2>, + tav::List<tav::Int<1>, 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<1>, tav::Int<2>, tav::Int<3>>, + tav::Section< + tav::Size<0>, + tav::Size<2>, + tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>> + > + >::value, + "(section 0 2 (list 1 2 3)) != (list 1 2 3)" +); + // list take static_assert( |