From f7706caa40132403d6c92ee660dc37560d032af5 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 19 Jan 2015 18:43:46 +0100 Subject: Added type and value equality test case --- test.cc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'test.cc') diff --git a/test.cc b/test.cc index 5b4467a..8ae99a7 100644 --- a/test.cc +++ b/test.cc @@ -9,8 +9,27 @@ int main(int, char **) { } -template -using quadruple = tav::Multiply, Element>; +// equality + +static_assert( + std::is_same, tav::EqualType, tav::Int<2>>>::value, + "(EqualType 1 2) != #t" +); + +static_assert( + std::is_same, tav::EqualType, tav::Size<1>>>::value, + "(EqualType (int 1) (size 2)) != #f" +); + +static_assert( + std::is_same, tav::EqualValue, tav::Size<1>>>::value, + "(equal? (int 1) (size 1)) != #t" +); + +static_assert( + std::is_same, tav::EqualValue, tav::Int<2>>>::value, + "(equal? 1 2) != #f" +); // basic math operations @@ -147,6 +166,9 @@ static_assert( // list map +template +using quadruple = tav::Multiply, Element>; + static_assert( std::is_same, tav::Int<8>, tav::Int<12>>::type, tav::Map, tav::Int<2>, tav::Int<3>>::type>::type>::value, "(map quadruple (list 1 2 3)) != (list 4 8 12)" -- cgit v1.2.3