diff --git a/.travis.yml b/.travis.yml index 2f524e426..8e6e52dab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,75 +3,75 @@ compiler: clang os: linux env: - - CLANG_VERSION=3.5 - - CLANG_VERSION=3.6 - - CLANG_VERSION=3.7 + - CLANG_VERSION=3.5 BOOST_VERSION=1.57.0 + - CLANG_VERSION=3.6 BOOST_VERSION=1.57.0 + - CLANG_VERSION=3.7 BOOST_VERSION=1.57.0 + + - CLANG_VERSION=3.5 BOOST_VERSION=1.58.0 + - CLANG_VERSION=3.6 BOOST_VERSION=1.58.0 + - CLANG_VERSION=3.7 BOOST_VERSION=1.58.0 + before_install: + # All the dependencies are installed to the deps/ subdirectory. + - mkdir deps + - DEPS_DIR="${PWD}/deps" + # Add deb repositories to get different versions of LLVM/Clang. # The latest version of those repositories doesn't need a -3.x suffix, # so we jump through the little hoop with _suffix below. - sudo apt-add-repository "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main" - - if [ "$CLANG_VERSION" != "3.7" ]; then _suffix="-${CLANG_VERSION}"; fi + - if [ "${CLANG_VERSION}" != "3.7" ]; then _suffix="-${CLANG_VERSION}"; fi - sudo apt-add-repository "deb http://llvm.org/apt/precise/ llvm-toolchain-precise${_suffix} main" - sudo apt-get -qq update # Checkout the latest libc++ - - svn --quiet co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx + - svn --quiet co http://llvm.org/svn/llvm-project/libcxx/trunk ${DEPS_DIR}/libcxx - # Install linuxbrew and its dependencies. - # We use +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +using namespace boost::hana; + + +template +constexpr auto array() { return std::array{{i...}}; } + +using test::ct_eq; + +int main() { + auto int_arrays = make( + array<>() + , array<0>() + , array<0, 1>() + , array<0, 1, 2>() + , array<0, 1, 2, 3>() + , array<0, 1, 2, 3, 4>() + ); + (void)int_arrays; + +#if BOOST_HANA_TEST_PART == 1 + ////////////////////////////////////////////////////////////////////////// + // Comparable + ////////////////////////////////////////////////////////////////////////// + test::TestComparable{int_arrays}; + +#elif BOOST_HANA_TEST_PART == 2 + ////////////////////////////////////////////////////////////////////////// + // Orderable + ////////////////////////////////////////////////////////////////////////// + test::TestOrderable{int_arrays}; + +#elif BOOST_HANA_TEST_PART == 3 + ////////////////////////////////////////////////////////////////////////// + // Foldable + ////////////////////////////////////////////////////////////////////////// + test::TestFoldable{int_arrays}; + +#elif BOOST_HANA_TEST_PART == 4 + ////////////////////////////////////////////////////////////////////////// + // Iterable + ////////////////////////////////////////////////////////////////////////// + { + // is_empty + { + BOOST_HANA_CONSTANT_CHECK(is_empty(array<>())); + BOOST_HANA_CONSTANT_CHECK(not_(is_empty(array<0>()))); + BOOST_HANA_CONSTANT_CHECK(not_(is_empty(array<0, 1>()))); + } + + // head + { + BOOST_HANA_CONSTEXPR_CHECK(head(array<0>()) == 0); + BOOST_HANA_CONSTEXPR_CHECK(head(array<0, 1>()) == 0); + BOOST_HANA_CONSTEXPR_CHECK(head(array<0, 1, 2>()) == 0); + } + + // tail + { + BOOST_HANA_CONSTANT_CHECK(equal( + tail(array<0>()), + array<>() + )); + BOOST_HANA_CONSTEXPR_CHECK(equal( + tail(array<0, 1>()), + array<1>() + )); + BOOST_HANA_CONSTEXPR_CHECK(equal( + tail(array<0, 1, 2>()), + array<1, 2>() + )); + BOOST_HANA_CONSTEXPR_CHECK(equal( + tail(array<0, 1, 2, 3>()), + array<1, 2, 3>() + )); + } + + // laws + test::TestIterable{int_arrays}; + } + +#elif BOOST_HANA_TEST_PART == 5 + ////////////////////////////////////////////////////////////////////////// + // Searchable + ////////////////////////////////////////////////////////////////////////// + { + auto eq_arrays = make( + std::array, 0>{} + , std::array, 1>{} + , std::array, 2>{} + , std::array, 3>{} + , std::array, 4>{} + ); + + auto eq_keys = make(ct_eq<0>{}); + + test::TestSearchable{eq_arrays, eq_keys}; + } +#endif +} diff --git a/test/ext/std/array/comparable.cpp b/test/ext/std/array/comparable.cpp deleted file mode 100644 index fa1b010df..000000000 --- a/test/ext/std/array/comparable.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include -#include - -#include - -#include -using namespace boost::hana; - - -template -constexpr auto array = std::array{{i...}}; - -int main() { - auto int_arrays = make( - array<> - , array<0> - , array<0, 1> - , array<0, 1, 2> - , array<0, 1, 2, 3> - , array<0, 1, 2, 3, 4> - ); - - ////////////////////////////////////////////////////////////////////////// - // Comparable - ////////////////////////////////////////////////////////////////////////// - test::TestComparable{int_arrays}; -} diff --git a/test/ext/std/array/iterable.cpp b/test/ext/std/array/iterable.cpp deleted file mode 100644 index 3a74fa56a..000000000 --- a/test/ext/std/array/iterable.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include -#include -#include - -#include -#include - -#include -using namespace boost::hana; - - -template -constexpr auto array = std::array{{i...}}; - -int main() { - auto int_arrays = make( - array<> - , array<0> - , array<0, 1> - , array<0, 1, 2> - , array<0, 1, 2, 3> - , array<0, 1, 2, 3, 4> - ); - - ////////////////////////////////////////////////////////////////////////// - // Foldable - ////////////////////////////////////////////////////////////////////////// - test::TestFoldable{int_arrays}; - - ////////////////////////////////////////////////////////////////////////// - // Iterable - ////////////////////////////////////////////////////////////////////////// - { - // is_empty - { - BOOST_HANA_CONSTANT_CHECK(is_empty(array<>)); - BOOST_HANA_CONSTANT_CHECK(not_(is_empty(array<0>))); - BOOST_HANA_CONSTANT_CHECK(not_(is_empty(array<0, 1>))); - } - - // head - { - BOOST_HANA_CONSTEXPR_CHECK(head(array<0>) == 0); - BOOST_HANA_CONSTEXPR_CHECK(head(array<0, 1>) == 0); - BOOST_HANA_CONSTEXPR_CHECK(head(array<0, 1, 2>) == 0); - } - - // tail - { - BOOST_HANA_CONSTANT_CHECK(equal( - tail(array<0>), - array<> - )); - BOOST_HANA_CONSTEXPR_CHECK(equal( - tail(array<0, 1>), - array<1> - )); - BOOST_HANA_CONSTEXPR_CHECK(equal( - tail(array<0, 1, 2>), - array<1, 2> - )); - BOOST_HANA_CONSTEXPR_CHECK(equal( - tail(array<0, 1, 2, 3>), - array<1, 2, 3> - )); - } - - // laws - test::TestIterable{int_arrays}; - } -} diff --git a/test/ext/std/array/orderable.cpp b/test/ext/std/array/orderable.cpp deleted file mode 100644 index 22b487da4..000000000 --- a/test/ext/std/array/orderable.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include -#include - -#include - -#include -using namespace boost::hana; - - -template -constexpr auto array = std::array{{i...}}; - -int main() { - auto int_arrays = make( - array<> - , array<0> - , array<0, 1> - , array<0, 1, 2> - , array<0, 1, 2, 3> - , array<0, 1, 2, 3, 4> - ); - - ////////////////////////////////////////////////////////////////////////// - // Orderable - ////////////////////////////////////////////////////////////////////////// - test::TestOrderable{int_arrays}; -} diff --git a/test/ext/std/array/searchable.cpp b/test/ext/std/array/searchable.cpp deleted file mode 100644 index 9c695b988..000000000 --- a/test/ext/std/array/searchable.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include -#include - -#include -#include - -#include -using namespace boost::hana; - - -using test::ct_eq; - -int main() { - auto eq_arrays = make( - std::array, 0>{} - , std::array, 1>{} - , std::array, 2>{} - , std::array, 3>{} - , std::array, 4>{} - ); - - auto eq_keys = make(ct_eq<0>{}); - - ////////////////////////////////////////////////////////////////////////// - // Searchable - ////////////////////////////////////////////////////////////////////////// - test::TestSearchable{eq_arrays, eq_keys}; -} diff --git a/test/ext/std/integer_sequence.cpp b/test/ext/std/integer_sequence.cpp new file mode 100644 index 000000000..58d41ff36 --- /dev/null +++ b/test/ext/std/integer_sequence.cpp @@ -0,0 +1,196 @@ +/* +@copyright Louis Dionne 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +using namespace boost::hana; + + +using T = int; +using U = long long; + +int main() { + auto sequences = make( + std::integer_sequence{}, + std::integer_sequence{}, + + std::integer_sequence{}, + std::integer_sequence{}, + + std::integer_sequence{}, + std::integer_sequence{}, + + std::integer_sequence{}, + std::integer_sequence{} + ); + (void)sequences; + +#if BOOST_HANA_TEST_PART == 1 + ////////////////////////////////////////////////////////////////////////// + // Comparable + ////////////////////////////////////////////////////////////////////////// + { + // equal + { + BOOST_HANA_CONSTANT_CHECK(equal( + std::integer_sequence{}, + std::integer_sequence{} + )); + BOOST_HANA_CONSTANT_CHECK(not_(equal( + std::integer_sequence{}, + std::integer_sequence{} + ))); + BOOST_HANA_CONSTANT_CHECK(not_(equal( + std::integer_sequence{}, + std::integer_sequence{} + ))); + + BOOST_HANA_CONSTANT_CHECK(equal( + std::integer_sequence{}, + std::integer_sequence{} + )); + BOOST_HANA_CONSTANT_CHECK(not_(equal( + std::integer_sequence{}, + std::integer_sequence{} + ))); + BOOST_HANA_CONSTANT_CHECK(not_(equal( + std::integer_sequence{}, + std::integer_sequence{} + ))); + + BOOST_HANA_CONSTANT_CHECK(equal( + std::integer_sequence{}, + std::integer_sequence{} + )); + BOOST_HANA_CONSTANT_CHECK(not_(equal( + std::integer_sequence{}, + std::integer_sequence{} + ))); + } + + // laws + test::TestComparable{sequences}; + } + +#elif BOOST_HANA_TEST_PART == 2 + ////////////////////////////////////////////////////////////////////////// + // Foldable + ////////////////////////////////////////////////////////////////////////// + { + // unpack + { + test::_injection<0> f{}; + + BOOST_HANA_CONSTANT_CHECK(equal( + unpack(std::integer_sequence{}, f), + f() + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + unpack(std::integer_sequence{}, f), + f(std::integral_constant{}) + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + unpack(std::integer_sequence{}, f), + f(std::integral_constant{}, std::integral_constant{}) + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + unpack(std::integer_sequence{}, f), + f(std::integral_constant{}, std::integral_constant{}, + std::integral_constant{}) + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + unpack(std::integer_sequence{}, f), + f(std::integral_constant{}, std::integral_constant{}, + std::integral_constant{}, std::integral_constant{}) + )); + } + + // laws + test::TestFoldable{sequences}; + } + +#elif BOOST_HANA_TEST_PART == 3 + ////////////////////////////////////////////////////////////////////////// + // Iterable + ////////////////////////////////////////////////////////////////////////// + { + // head + { + BOOST_HANA_CONSTANT_CHECK(equal( + head(std::index_sequence<0>{}), + std::integral_constant{} + )); + BOOST_HANA_CONSTANT_CHECK(equal( + head(std::index_sequence<0, 1>{}), + std::integral_constant{} + )); + } + + // is_empty + { + BOOST_HANA_CONSTANT_CHECK(is_empty(std::index_sequence<>{})); + BOOST_HANA_CONSTANT_CHECK(not_(is_empty(std::index_sequence<0>{}))); + BOOST_HANA_CONSTANT_CHECK(not_(is_empty(std::index_sequence<1>{}))); + } + + // tail + { + BOOST_HANA_CONSTANT_CHECK(equal( + tail(std::index_sequence<0>{}), + std::index_sequence<>{} + )); + BOOST_HANA_CONSTANT_CHECK(equal( + tail(std::index_sequence<0, 1>{}), + std::index_sequence<1>{} + )); + BOOST_HANA_CONSTANT_CHECK(equal( + tail(std::index_sequence<0, 1, 2>{}), + std::index_sequence<1, 2>{} + )); + } + + // laws + test::TestIterable{sequences}; + } + +#elif BOOST_HANA_TEST_PART == 4 + ////////////////////////////////////////////////////////////////////////// + // Searchable + ////////////////////////////////////////////////////////////////////////// + { + auto sequences = make( + std::integer_sequence{}, + std::integer_sequence{}, + std::integer_sequence{}, + std::integer_sequence{}, + std::integer_sequence{} + ); + + auto keys = make( + std::integral_constant{}, std::integral_constant{} + ); + + // laws + test::TestSearchable{sequences, keys}; + } +#endif +} diff --git a/test/ext/std/integer_sequence/comparable.cpp b/test/ext/std/integer_sequence/comparable.cpp deleted file mode 100644 index 49f03681f..000000000 --- a/test/ext/std/integer_sequence/comparable.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include -#include - -#include - -#include -using namespace boost::hana; - - -using T = int; -using U = long long; - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Setup for the laws below - ////////////////////////////////////////////////////////////////////////// - auto sequences = make( - std::integer_sequence{}, - std::integer_sequence{}, - - std::integer_sequence{}, - std::integer_sequence{}, - - std::integer_sequence{}, - std::integer_sequence{}, - - std::integer_sequence{}, - std::integer_sequence{} - ); - - ////////////////////////////////////////////////////////////////////////// - // Comparable - ////////////////////////////////////////////////////////////////////////// - { - // equal - { - BOOST_HANA_CONSTANT_CHECK(equal( - std::integer_sequence{}, - std::integer_sequence{} - )); - BOOST_HANA_CONSTANT_CHECK(not_(equal( - std::integer_sequence{}, - std::integer_sequence{} - ))); - BOOST_HANA_CONSTANT_CHECK(not_(equal( - std::integer_sequence{}, - std::integer_sequence{} - ))); - - BOOST_HANA_CONSTANT_CHECK(equal( - std::integer_sequence{}, - std::integer_sequence{} - )); - BOOST_HANA_CONSTANT_CHECK(not_(equal( - std::integer_sequence{}, - std::integer_sequence{} - ))); - BOOST_HANA_CONSTANT_CHECK(not_(equal( - std::integer_sequence{}, - std::integer_sequence{} - ))); - - BOOST_HANA_CONSTANT_CHECK(equal( - std::integer_sequence{}, - std::integer_sequence{} - )); - BOOST_HANA_CONSTANT_CHECK(not_(equal( - std::integer_sequence{}, - std::integer_sequence{} - ))); - } - - // laws - test::TestComparable{sequences}; - } -} diff --git a/test/ext/std/integer_sequence/foldable.cpp b/test/ext/std/integer_sequence/foldable.cpp deleted file mode 100644 index adb9e8bef..000000000 --- a/test/ext/std/integer_sequence/foldable.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include -#include -#include -#include - -#include -#include - -#include -#include -using namespace boost::hana; - - -using T = int; -using U = long long; - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Setup for the laws below - ////////////////////////////////////////////////////////////////////////// - auto sequences = make( - std::integer_sequence{}, - std::integer_sequence{}, - - std::integer_sequence{}, - std::integer_sequence{}, - - std::integer_sequence{}, - std::integer_sequence{}, - - std::integer_sequence{}, - std::integer_sequence{} - ); - - ////////////////////////////////////////////////////////////////////////// - // Foldable - ////////////////////////////////////////////////////////////////////////// - { - // unpack - { - test::_injection<0> f{}; - - BOOST_HANA_CONSTANT_CHECK(equal( - unpack(std::integer_sequence{}, f), - f() - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - unpack(std::integer_sequence{}, f), - f(std::integral_constant{}) - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - unpack(std::integer_sequence{}, f), - f(std::integral_constant{}, std::integral_constant{}) - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - unpack(std::integer_sequence{}, f), - f(std::integral_constant{}, std::integral_constant{}, - std::integral_constant{}) - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - unpack(std::integer_sequence{}, f), - f(std::integral_constant{}, std::integral_constant{}, - std::integral_constant{}, std::integral_constant{}) - )); - } - - // laws - test::TestFoldable{sequences}; - } -} diff --git a/test/ext/std/integer_sequence/iterable.cpp b/test/ext/std/integer_sequence/iterable.cpp deleted file mode 100644 index 047d59d76..000000000 --- a/test/ext/std/integer_sequence/iterable.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include -#include - -#include -#include - -#include - -#include -#include -using namespace boost::hana; - - -using T = int; -using U = long long; - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Setup for the laws below - ////////////////////////////////////////////////////////////////////////// - auto sequences = make( - std::integer_sequence{}, - std::integer_sequence{}, - - std::integer_sequence{}, - std::integer_sequence{}, - - std::integer_sequence{}, - std::integer_sequence{}, - - std::integer_sequence{}, - std::integer_sequence{} - ); - - ////////////////////////////////////////////////////////////////////////// - // Iterable - ////////////////////////////////////////////////////////////////////////// - // head - { - BOOST_HANA_CONSTANT_CHECK(equal( - head(std::index_sequence<0>{}), - std::integral_constant{} - )); - BOOST_HANA_CONSTANT_CHECK(equal( - head(std::index_sequence<0, 1>{}), - std::integral_constant{} - )); - } - - // is_empty - { - BOOST_HANA_CONSTANT_CHECK(is_empty(std::index_sequence<>{})); - BOOST_HANA_CONSTANT_CHECK(not_(is_empty(std::index_sequence<0>{}))); - BOOST_HANA_CONSTANT_CHECK(not_(is_empty(std::index_sequence<1>{}))); - } - - // tail - { - BOOST_HANA_CONSTANT_CHECK(equal( - tail(std::index_sequence<0>{}), - std::index_sequence<>{} - )); - BOOST_HANA_CONSTANT_CHECK(equal( - tail(std::index_sequence<0, 1>{}), - std::index_sequence<1>{} - )); - BOOST_HANA_CONSTANT_CHECK(equal( - tail(std::index_sequence<0, 1, 2>{}), - std::index_sequence<1, 2>{} - )); - } - - // laws - test::TestIterable{sequences}; -} diff --git a/test/ext/std/integer_sequence/searchable.cpp b/test/ext/std/integer_sequence/searchable.cpp deleted file mode 100644 index e1c86f8de..000000000 --- a/test/ext/std/integer_sequence/searchable.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include -#include -#include - -#include - -#include -using namespace boost::hana; - - -using T = int; -using U = long long; - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Setup for the laws below - ////////////////////////////////////////////////////////////////////////// - auto sequences = make( - std::integer_sequence{}, - std::integer_sequence{}, - std::integer_sequence{}, - std::integer_sequence{}, - std::integer_sequence{}, - std::integer_sequence{} - ); - - auto keys = make( - integral_constant, integral_constant - ); - - ////////////////////////////////////////////////////////////////////////// - // Searchable - ////////////////////////////////////////////////////////////////////////// - { - // laws - test::TestSearchable{sequences, keys}; - } -} diff --git a/test/ext/std/ratio.cpp b/test/ext/std/ratio.cpp new file mode 100644 index 000000000..07aeea96a --- /dev/null +++ b/test/ext/std/ratio.cpp @@ -0,0 +1,234 @@ +/* +@copyright Louis Dionne 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +using namespace boost::hana; + + +int main() { + auto ratios = make( + std::ratio<0>{} + , std::ratio<1, 3>{} + , std::ratio<1, 2>{} + , std::ratio<2, 6>{} + , std::ratio<3, 1>{} + , std::ratio<7, 8>{} + , std::ratio<3, 5>{} + , std::ratio<2, 1>{} + ); + (void)ratios; + +#if BOOST_HANA_TEST_PART == 1 + ////////////////////////////////////////////////////////////////////////// + // Conversions + ////////////////////////////////////////////////////////////////////////// + { + // Constant -> Ratio + { + BOOST_HANA_CONSTANT_CHECK(equal( + to(test::cnumeric), + std::ratio<0>{} + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + to(test::cnumeric), + std::ratio<1>{} + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + to(test::cnumeric), + std::ratio<3>{} + )); + } + } + + ////////////////////////////////////////////////////////////////////////// + // Comparable + ////////////////////////////////////////////////////////////////////////// + { + // equal + { + BOOST_HANA_CONSTANT_CHECK(equal( + std::ratio<0>{}, + std::ratio<0>{} + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + std::ratio<3, 5>{}, + std::ratio<6, 10>{} + )); + + BOOST_HANA_CONSTANT_CHECK(not_(equal( + std::ratio<4, 5>{}, + std::ratio<6, 10>{} + ))); + } + + // laws + test::TestComparable{ratios}; + } + +#elif BOOST_HANA_TEST_PART == 2 + ////////////////////////////////////////////////////////////////////////// + // Orderable + ////////////////////////////////////////////////////////////////////////// + { + // less + { + BOOST_HANA_CONSTANT_CHECK(less( + std::ratio<1>{}, + std::ratio<3>{} + )); + + BOOST_HANA_CONSTANT_CHECK(less( + std::ratio<4, 10>{}, + std::ratio<3, 5>{} + )); + + BOOST_HANA_CONSTANT_CHECK(not_(less( + std::ratio<3, 5>{}, + std::ratio<4, 10>{} + ))); + } + + // laws + auto ratios = make( + std::ratio<0>{} + , std::ratio<1, 3>{} + , std::ratio<1, 2>{} + , std::ratio<2, 6>{} + , std::ratio<7, 8>{} + , std::ratio<3, 5>{} + ); + + test::TestOrderable{ratios}; + } + +#elif BOOST_HANA_TEST_PART == 3 + ////////////////////////////////////////////////////////////////////////// + // Monoid + ////////////////////////////////////////////////////////////////////////// + { + // plus + { + BOOST_HANA_CONSTANT_CHECK(equal( + plus(std::ratio<3, 4>{}, std::ratio<5, 10>{}), + std::ratio<3*10 + 5*4, 4*10>{} + )); + } + + // zero + { + BOOST_HANA_CONSTANT_CHECK(equal( + zero(), + std::ratio<0, 1>{} + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + zero(), + std::ratio<0, 2>{} + )); + } + + // laws + test::TestMonoid{ratios}; + } + + ////////////////////////////////////////////////////////////////////////// + // Group + ////////////////////////////////////////////////////////////////////////// + { + // minus + { + BOOST_HANA_CONSTANT_CHECK(equal( + minus(std::ratio<3, 4>{}, std::ratio<5, 10>{}), + std::ratio<3*10 - 5*4, 4*10>{} + )); + } + + // laws + test::TestGroup{ratios}; + } + +#elif BOOST_HANA_TEST_PART == 4 + ////////////////////////////////////////////////////////////////////////// + // Ring + ////////////////////////////////////////////////////////////////////////// + { + // mult + { + BOOST_HANA_CONSTANT_CHECK(equal( + mult(std::ratio<3, 4>{}, std::ratio<5, 10>{}), + std::ratio<3*5, 4*10>{} + )); + } + + // one + { + BOOST_HANA_CONSTANT_CHECK(equal( + one(), + std::ratio<1, 1>{} + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + one(), + std::ratio<2, 2>{} + )); + } + + // laws + test::TestRing{ratios}; + } + +#elif BOOST_HANA_TEST_PART == 5 + ////////////////////////////////////////////////////////////////////////// + // IntegralDomain + ////////////////////////////////////////////////////////////////////////// + { + // quot + { + BOOST_HANA_CONSTANT_CHECK(equal( + quot(std::ratio<6>{}, std::ratio<4>{}), + std::ratio<6, 4>{} + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + quot(std::ratio<3, 4>{}, std::ratio<5, 10>{}), + std::ratio<3*10, 4*5>{} + )); + } + + // rem + { + BOOST_HANA_CONSTANT_CHECK(equal( + rem(std::ratio<6>{}, std::ratio<4>{}), + std::ratio<0>{} + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + rem(std::ratio<3, 4>{}, std::ratio<5, 10>{}), + std::ratio<0>{} + )); + } + + // laws + test::TestIntegralDomain{ratios}; + } +#endif +} diff --git a/test/ext/std/ratio/comparable.cpp b/test/ext/std/ratio/comparable.cpp deleted file mode 100644 index a8e95e42b..000000000 --- a/test/ext/std/ratio/comparable.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include -#include - -#include - -#include -using namespace boost::hana; - - -int main() { - auto ratios = make( - std::ratio<0>{} - , std::ratio<1, 3>{} - , std::ratio<1, 2>{} - , std::ratio<2, 6>{} - , std::ratio<3, 1>{} - , std::ratio<7, 8>{} - , std::ratio<3, 5>{} - , std::ratio<2, 1>{} - ); - - ////////////////////////////////////////////////////////////////////////// - // Comparable - ////////////////////////////////////////////////////////////////////////// - { - // equal - { - BOOST_HANA_CONSTANT_CHECK(equal( - std::ratio<0>{}, - std::ratio<0>{} - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - std::ratio<3, 5>{}, - std::ratio<6, 10>{} - )); - - BOOST_HANA_CONSTANT_CHECK(not_(equal( - std::ratio<4, 5>{}, - std::ratio<6, 10>{} - ))); - } - - // laws - test::TestComparable{ratios}; - } -} diff --git a/test/ext/std/ratio/conversions.cpp b/test/ext/std/ratio/conversions.cpp deleted file mode 100644 index 027bff526..000000000 --- a/test/ext/std/ratio/conversions.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include - -#include - -#include -using namespace boost::hana; - - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Conversions - ////////////////////////////////////////////////////////////////////////// - { - // Constant -> Ratio - { - BOOST_HANA_CONSTANT_CHECK(equal( - to(test::cnumeric), - std::ratio<0>{} - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - to(test::cnumeric), - std::ratio<1>{} - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - to(test::cnumeric), - std::ratio<3>{} - )); - } - } -} diff --git a/test/ext/std/ratio/group.cpp b/test/ext/std/ratio/group.cpp deleted file mode 100644 index 77e1b27ed..000000000 --- a/test/ext/std/ratio/group.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include -#include - -#include -#include - -#include -using namespace boost::hana; - - -int main() { - auto ratios = make( - std::ratio<0>{} - , std::ratio<1, 3>{} - , std::ratio<1, 2>{} - , std::ratio<2, 6>{} - , std::ratio<3, 1>{} - , std::ratio<7, 8>{} - , std::ratio<3, 5>{} - , std::ratio<2, 1>{} - ); - - ////////////////////////////////////////////////////////////////////////// - // Monoid - ////////////////////////////////////////////////////////////////////////// - { - // plus - { - BOOST_HANA_CONSTANT_CHECK(equal( - plus(std::ratio<3, 4>{}, std::ratio<5, 10>{}), - std::ratio<3*10 + 5*4, 4*10>{} - )); - } - - // zero - { - BOOST_HANA_CONSTANT_CHECK(equal( - zero(), - std::ratio<0, 1>{} - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - zero(), - std::ratio<0, 2>{} - )); - } - - // laws - test::TestMonoid{ratios}; - } - - ////////////////////////////////////////////////////////////////////////// - // Group - ////////////////////////////////////////////////////////////////////////// - { - // minus - { - BOOST_HANA_CONSTANT_CHECK(equal( - minus(std::ratio<3, 4>{}, std::ratio<5, 10>{}), - std::ratio<3*10 - 5*4, 4*10>{} - )); - } - - // laws - test::TestGroup{ratios}; - } -} diff --git a/test/ext/std/ratio/integral_domain.cpp b/test/ext/std/ratio/integral_domain.cpp deleted file mode 100644 index 1454d033f..000000000 --- a/test/ext/std/ratio/integral_domain.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include -#include - -#include - -#include -using namespace boost::hana; - - -int main() { - auto ratios = make( - std::ratio<0>{} - , std::ratio<1, 3>{} - , std::ratio<1, 2>{} - , std::ratio<2, 6>{} - , std::ratio<3, 1>{} - , std::ratio<7, 8>{} - , std::ratio<3, 5>{} - , std::ratio<2, 1>{} - ); - - ////////////////////////////////////////////////////////////////////////// - // IntegralDomain - ////////////////////////////////////////////////////////////////////////// - { - // quot - { - BOOST_HANA_CONSTANT_CHECK(equal( - quot(std::ratio<6>{}, std::ratio<4>{}), - std::ratio<6, 4>{} - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - quot(std::ratio<3, 4>{}, std::ratio<5, 10>{}), - std::ratio<3*10, 4*5>{} - )); - } - - // rem - { - BOOST_HANA_CONSTANT_CHECK(equal( - rem(std::ratio<6>{}, std::ratio<4>{}), - std::ratio<0>{} - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - rem(std::ratio<3, 4>{}, std::ratio<5, 10>{}), - std::ratio<0>{} - )); - } - - // laws - test::TestIntegralDomain{ratios}; - } -} diff --git a/test/ext/std/ratio/orderable.cpp b/test/ext/std/ratio/orderable.cpp deleted file mode 100644 index b0bb6b1f0..000000000 --- a/test/ext/std/ratio/orderable.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include -#include - -#include - -#include -using namespace boost::hana; - - -int main() { - auto ratios = make( - std::ratio<0>{} - , std::ratio<1, 3>{} - , std::ratio<1, 2>{} - , std::ratio<2, 6>{} - , std::ratio<7, 8>{} - , std::ratio<3, 5>{} - ); - - ////////////////////////////////////////////////////////////////////////// - // Orderable - ////////////////////////////////////////////////////////////////////////// - { - // less - { - BOOST_HANA_CONSTANT_CHECK(less( - std::ratio<1>{}, - std::ratio<3>{} - )); - - BOOST_HANA_CONSTANT_CHECK(less( - std::ratio<4, 10>{}, - std::ratio<3, 5>{} - )); - - BOOST_HANA_CONSTANT_CHECK(not_(less( - std::ratio<3, 5>{}, - std::ratio<4, 10>{} - ))); - } - - // laws - test::TestOrderable{ratios}; - } -} diff --git a/test/ext/std/ratio/ring.cpp b/test/ext/std/ratio/ring.cpp deleted file mode 100644 index f670cae62..000000000 --- a/test/ext/std/ratio/ring.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include -#include - -#include - -#include -using namespace boost::hana; - - -int main() { - auto ratios = make( - std::ratio<0>{} - , std::ratio<1, 3>{} - , std::ratio<1, 2>{} - , std::ratio<2, 6>{} - , std::ratio<3, 1>{} - , std::ratio<7, 8>{} - , std::ratio<3, 5>{} - , std::ratio<2, 1>{} - ); - - ////////////////////////////////////////////////////////////////////////// - // Ring - ////////////////////////////////////////////////////////////////////////// - { - // mult - { - BOOST_HANA_CONSTANT_CHECK(equal( - mult(std::ratio<3, 4>{}, std::ratio<5, 10>{}), - std::ratio<3*5, 4*10>{} - )); - } - - // one - { - BOOST_HANA_CONSTANT_CHECK(equal( - one(), - std::ratio<1, 1>{} - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - one(), - std::ratio<2, 2>{} - )); - } - - // laws - test::TestRing{ratios}; - } -} diff --git a/test/integral_constant/constexpr_init.cpp b/test/integral_constant.constexpr_init.cpp similarity index 100% rename from test/integral_constant/constexpr_init.cpp rename to test/integral_constant.constexpr_init.cpp diff --git a/test/integral_constant.cpp b/test/integral_constant.cpp new file mode 100644 index 000000000..fb486049c --- /dev/null +++ b/test/integral_constant.cpp @@ -0,0 +1,256 @@ +/* +@copyright Louis Dionne 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +using namespace boost::hana; + + +int main() { + auto ints = make( + int_<-10>, int_<-2>, int_<0>, int_<1>, int_<3>, int_<4> + ); + (void)ints; + + auto bools = make(true_, false_); + (void)bools; + +#if BOOST_HANA_TEST_PART == 1 + ////////////////////////////////////////////////////////////////////////// + // IntegralConstant's API (like std::integral_constant) + ////////////////////////////////////////////////////////////////////////// + { + // operator() + static_assert(size_t<0>() == 0, ""); + static_assert(size_t<1>() == 1, ""); + static_assert(int_<-3>() == -3, ""); + + // decltype(operator()) + static_assert(std::is_same()), std::size_t>{}, ""); + static_assert(std::is_same()), int>{}, ""); + + // conversions + constexpr std::size_t a = size_t<0>, b = size_t<1>; + static_assert(a == 0 && b == 1, ""); + + constexpr int c = int_<0>, d = int_<-3>; + static_assert(c == 0 && d == -3, ""); + + // nested ::value + static_assert(decltype(int_<1>)::value == 1, ""); + + // nested ::type + static_assert(std::is_same< + decltype(int_<1>)::type, + std::remove_cv_t)> + >{}, ""); + + // nested ::value_type + static_assert(std::is_same)::value_type, int>{}, ""); + } + + ////////////////////////////////////////////////////////////////////////// + // Make sure we can inherit _integral_constant and retain the same + // data type. + ////////////////////////////////////////////////////////////////////////// + { + struct derived : _integral_constant { }; + static_assert(std::is_same, IntegralConstant>{}, ""); + } + + ////////////////////////////////////////////////////////////////////////// + // Extensions to std::integral_constant + ////////////////////////////////////////////////////////////////////////// + { + // times member function (the other ones are tested in the examples) + { + int counter = 0; + int_<3>.times([&] { ++counter; }); + BOOST_HANA_RUNTIME_CHECK(counter == 3); + } + + // Arithmetic operators + { + BOOST_HANA_CONSTANT_CHECK(+int_<1> == int_<1>); + BOOST_HANA_CONSTANT_CHECK(-int_<1> == int_<-1>); + BOOST_HANA_CONSTANT_CHECK(int_<1> + int_<2> == int_<3>); + BOOST_HANA_CONSTANT_CHECK(int_<1> - int_<2> == int_<-1>); + BOOST_HANA_CONSTANT_CHECK(int_<3> * int_<2> == int_<6>); + BOOST_HANA_CONSTANT_CHECK(int_<6> / int_<3> == int_<2>); + BOOST_HANA_CONSTANT_CHECK(int_<6> % int_<4> == int_<2>); + BOOST_HANA_CONSTANT_CHECK(~int_<6> == int_<~6>); + BOOST_HANA_CONSTANT_CHECK((int_<6> & int_<3>) == int_<6 & 3>); + BOOST_HANA_CONSTANT_CHECK((int_<4> | int_<2>) == int_<4 | 2>); + BOOST_HANA_CONSTANT_CHECK((int_<6> ^ int_<3>) == int_<6 ^ 3>); + BOOST_HANA_CONSTANT_CHECK((int_<6> << int_<3>) == int_<(6 << 3)>); + BOOST_HANA_CONSTANT_CHECK((int_<6> >> int_<3>) == int_<(6 >> 3)>); + } + + // Comparison operators + { + BOOST_HANA_CONSTANT_CHECK(int_<0> == int_<0>); + BOOST_HANA_CONSTANT_CHECK(int_<1> != int_<0>); + BOOST_HANA_CONSTANT_CHECK(int_<0> < int_<1>); + BOOST_HANA_CONSTANT_CHECK(int_<0> <= int_<1>); + BOOST_HANA_CONSTANT_CHECK(int_<0> <= int_<0>); + BOOST_HANA_CONSTANT_CHECK(int_<1> > int_<0>); + BOOST_HANA_CONSTANT_CHECK(int_<1> >= int_<0>); + BOOST_HANA_CONSTANT_CHECK(int_<0> >= int_<0>); + } + + // Logical operators + { + BOOST_HANA_CONSTANT_CHECK(int_<3> || int_<0>); + BOOST_HANA_CONSTANT_CHECK(int_<3> && int_<1>); + BOOST_HANA_CONSTANT_CHECK(!int_<0>); + BOOST_HANA_CONSTANT_CHECK(!!int_<3>); + } + + // Creation with user-defined literals + { + using namespace boost::hana::literals; + + BOOST_HANA_CONSTANT_CHECK(0_c == llong<0>); + BOOST_HANA_CONSTANT_CHECK(1_c == llong<1>); + BOOST_HANA_CONSTANT_CHECK(12_c == llong<12>); + BOOST_HANA_CONSTANT_CHECK(123_c == llong<123>); + BOOST_HANA_CONSTANT_CHECK(1234567_c == llong<1234567>); + BOOST_HANA_CONSTANT_CHECK(-34_c == llong<-34>); + + BOOST_HANA_CONSTANT_CHECK(decltype_(-1234_c) == decltype_(llong<-1234>)); + BOOST_HANA_CONSTANT_CHECK(-12_c < 0_c); + } + } + +#elif BOOST_HANA_TEST_PART == 2 + ////////////////////////////////////////////////////////////////////////// + // Constant + ////////////////////////////////////////////////////////////////////////// + { + // value + static_assert(value(integral_constant) == 0, ""); + static_assert(value(integral_constant) == 1, ""); + + // laws + test::TestConstant>{ints}; + test::TestConstant>{bools}; + } + +#elif BOOST_HANA_TEST_PART == 3 + ////////////////////////////////////////////////////////////////////////// + // Enumerable, Monoid, Group + ////////////////////////////////////////////////////////////////////////// + { + // operators + static_assert(has_operator, decltype(plus)>{}, ""); + static_assert(has_operator, decltype(minus)>{}, ""); + static_assert(has_operator, decltype(negate)>{}, ""); + + // laws + test::TestEnumerable>{ints}; + test::TestMonoid>{ints}; + test::TestGroup>{ints}; + } + +#elif BOOST_HANA_TEST_PART == 4 + ////////////////////////////////////////////////////////////////////////// + // Ring, IntegralDomain + ////////////////////////////////////////////////////////////////////////// + { + // operators + static_assert(has_operator, decltype(mult)>{}, ""); + static_assert(has_operator, decltype(quot)>{}, ""); + static_assert(has_operator, decltype(rem)>{}, ""); + + // laws + test::TestRing>{ints}; + test::TestIntegralDomain>{ints}; + } + +#elif BOOST_HANA_TEST_PART == 5 + ////////////////////////////////////////////////////////////////////////// + // Logical + ////////////////////////////////////////////////////////////////////////// + { + auto t = test::ct_eq<3>{}; + auto e = test::ct_eq<4>{}; + + // eval_if + { + BOOST_HANA_CONSTANT_CHECK(equal( + eval_if(true_, always(t), always(e)), + t + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + eval_if(false_, always(t), always(e)), + e + )); + } + + // not_ + { + BOOST_HANA_CONSTANT_CHECK(equal(not_(true_), false_)); + BOOST_HANA_CONSTANT_CHECK(equal(not_(false_), true_)); + } + + // operators + static_assert(has_operator, decltype(not_)>{}, ""); + static_assert(has_operator, decltype(and_)>{}, ""); + static_assert(has_operator, decltype(or_)>{}, ""); + + // laws + auto ints = make(int_<-2>, int_<0>, int_<1>, int_<3>); + test::TestLogical>{ints}; + test::TestLogical>{bools}; + } + +#elif BOOST_HANA_TEST_PART == 6 + ////////////////////////////////////////////////////////////////////////// + // Comparable + ////////////////////////////////////////////////////////////////////////// + { + // operators + static_assert(has_operator, decltype(equal)>{}, ""); + static_assert(has_operator, decltype(not_equal)>{}, ""); + + // laws + test::TestComparable>{ints}; + } + +#elif BOOST_HANA_TEST_PART == 7 + ////////////////////////////////////////////////////////////////////////// + // Orderable + ////////////////////////////////////////////////////////////////////////// + { + // operators + static_assert(has_operator, decltype(less)>{}, ""); + static_assert(has_operator, decltype(less_equal)>{}, ""); + static_assert(has_operator, decltype(greater)>{}, ""); + static_assert(has_operator, decltype(greater_equal)>{}, ""); + + // laws + test::TestOrderable>{ints}; + } +#endif +} diff --git a/test/integral_constant/api.cpp b/test/integral_constant/api.cpp deleted file mode 100644 index fb8c47b7a..000000000 --- a/test/integral_constant/api.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include -#include -#include -#include - -#include -#include -using namespace boost::hana; - - -int main() { - ////////////////////////////////////////////////////////////////////////// - // IntegralConstant's API (like std::integral_constant) - ////////////////////////////////////////////////////////////////////////// - { - // operator() - static_assert(size_t<0>() == 0, ""); - static_assert(size_t<1>() == 1, ""); - static_assert(int_<-3>() == -3, ""); - - // decltype(operator()) - BOOST_HANA_CONSTANT_CHECK(decltype_(size_t<0>()) == type); - BOOST_HANA_CONSTANT_CHECK(decltype_(int_<-3>()) == type); - - // conversions - constexpr std::size_t a = size_t<0>, b = size_t<1>; - static_assert(a == 0 && b == 1, ""); - - constexpr int c = int_<0>, d = int_<-3>; - static_assert(c == 0 && d == -3, ""); - - // nested ::value - static_assert(decltype(int_<1>)::value == 1, ""); - - // nested ::type - static_assert(std::is_same< - decltype(int_<1>)::type, - std::remove_cv_t)> - >{}, ""); - - // nested ::value_type - static_assert(std::is_same)::value_type, int>{}, ""); - } - - ////////////////////////////////////////////////////////////////////////// - // Make sure we can inherit _integral_constant and retain the same - // data type. - ////////////////////////////////////////////////////////////////////////// - { - struct derived : _integral_constant { }; - static_assert(std::is_same, IntegralConstant>{}, ""); - } - - ////////////////////////////////////////////////////////////////////////// - // Extensions to std::integral_constant - ////////////////////////////////////////////////////////////////////////// - { - // times member function (the other ones are tested in the examples) - { - int counter = 0; - int_<3>.times([&] { ++counter; }); - BOOST_HANA_RUNTIME_CHECK(counter == 3); - } - - // Arithmetic operators - { - BOOST_HANA_CONSTANT_CHECK(+int_<1> == int_<1>); - BOOST_HANA_CONSTANT_CHECK(-int_<1> == int_<-1>); - BOOST_HANA_CONSTANT_CHECK(int_<1> + int_<2> == int_<3>); - BOOST_HANA_CONSTANT_CHECK(int_<1> - int_<2> == int_<-1>); - BOOST_HANA_CONSTANT_CHECK(int_<3> * int_<2> == int_<6>); - BOOST_HANA_CONSTANT_CHECK(int_<6> / int_<3> == int_<2>); - BOOST_HANA_CONSTANT_CHECK(int_<6> % int_<4> == int_<2>); - BOOST_HANA_CONSTANT_CHECK(~int_<6> == int_<~6>); - BOOST_HANA_CONSTANT_CHECK((int_<6> & int_<3>) == int_<6 & 3>); - BOOST_HANA_CONSTANT_CHECK((int_<4> | int_<2>) == int_<4 | 2>); - BOOST_HANA_CONSTANT_CHECK((int_<6> ^ int_<3>) == int_<6 ^ 3>); - BOOST_HANA_CONSTANT_CHECK((int_<6> << int_<3>) == int_<(6 << 3)>); - BOOST_HANA_CONSTANT_CHECK((int_<6> >> int_<3>) == int_<(6 >> 3)>); - } - - // Comparison operators - { - BOOST_HANA_CONSTANT_CHECK(int_<0> == int_<0>); - BOOST_HANA_CONSTANT_CHECK(int_<1> != int_<0>); - BOOST_HANA_CONSTANT_CHECK(int_<0> < int_<1>); - BOOST_HANA_CONSTANT_CHECK(int_<0> <= int_<1>); - BOOST_HANA_CONSTANT_CHECK(int_<0> <= int_<0>); - BOOST_HANA_CONSTANT_CHECK(int_<1> > int_<0>); - BOOST_HANA_CONSTANT_CHECK(int_<1> >= int_<0>); - BOOST_HANA_CONSTANT_CHECK(int_<0> >= int_<0>); - } - - // Logical operators - { - BOOST_HANA_CONSTANT_CHECK(int_<3> || int_<0>); - BOOST_HANA_CONSTANT_CHECK(int_<3> && int_<1>); - BOOST_HANA_CONSTANT_CHECK(!int_<0>); - BOOST_HANA_CONSTANT_CHECK(!!int_<3>); - } - - // Creation with user-defined literals - { - using namespace boost::hana::literals; - - BOOST_HANA_CONSTANT_CHECK(0_c == llong<0>); - BOOST_HANA_CONSTANT_CHECK(1_c == llong<1>); - BOOST_HANA_CONSTANT_CHECK(12_c == llong<12>); - BOOST_HANA_CONSTANT_CHECK(123_c == llong<123>); - BOOST_HANA_CONSTANT_CHECK(1234567_c == llong<1234567>); - BOOST_HANA_CONSTANT_CHECK(-34_c == llong<-34>); - - BOOST_HANA_CONSTANT_CHECK(decltype_(-1234_c) == decltype_(llong<-1234>)); - BOOST_HANA_CONSTANT_CHECK(-12_c < 0_c); - } - } -} diff --git a/test/integral_constant/constant.cpp b/test/integral_constant/constant.cpp deleted file mode 100644 index 559bf7f48..000000000 --- a/test/integral_constant/constant.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include - -#include -using namespace boost::hana; - - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Constant - ////////////////////////////////////////////////////////////////////////// - { - // value - static_assert(value(integral_constant) == 0, ""); - static_assert(value(integral_constant) == 1, ""); - - // laws - test::TestConstant>{tuple_c}; - test::TestConstant>{tuple_c}; - } -} diff --git a/test/integral_constant/integral_domain.cpp b/test/integral_constant/integral_domain.cpp deleted file mode 100644 index f1d95c24f..000000000 --- a/test/integral_constant/integral_domain.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include - -#include -#include -#include -#include -#include -using namespace boost::hana; - - -int main() { - auto int_constants = tuple_c; - - ////////////////////////////////////////////////////////////////////////// - // Enumerable, Monoid, Group, Ring, IntegralDomain - ////////////////////////////////////////////////////////////////////////// - { - // operators - static_assert(has_operator, decltype(plus)>{}, ""); - static_assert(has_operator, decltype(minus)>{}, ""); - static_assert(has_operator, decltype(negate)>{}, ""); - static_assert(has_operator, decltype(mult)>{}, ""); - static_assert(has_operator, decltype(quot)>{}, ""); - static_assert(has_operator, decltype(rem)>{}, ""); - - // laws - test::TestEnumerable>{int_constants}; - test::TestMonoid>{int_constants}; - test::TestGroup>{int_constants}; - test::TestRing>{int_constants}; - test::TestIntegralDomain>{int_constants}; - } -} diff --git a/test/integral_constant/logical.cpp b/test/integral_constant/logical.cpp deleted file mode 100644 index 786b84030..000000000 --- a/test/integral_constant/logical.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include -#include - -#include -#include -using namespace boost::hana; - - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Logical - ////////////////////////////////////////////////////////////////////////// - { - auto t = test::ct_eq<3>{}; - auto e = test::ct_eq<4>{}; - - // eval_if - { - BOOST_HANA_CONSTANT_CHECK(equal( - eval_if(true_, always(t), always(e)), - t - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - eval_if(false_, always(t), always(e)), - e - )); - } - - // not_ - { - BOOST_HANA_CONSTANT_CHECK(equal(not_(true_), false_)); - BOOST_HANA_CONSTANT_CHECK(equal(not_(false_), true_)); - } - - // operators - static_assert(has_operator, decltype(not_)>{}, ""); - static_assert(has_operator, decltype(and_)>{}, ""); - static_assert(has_operator, decltype(or_)>{}, ""); - - // laws - test::TestLogical>{tuple_c}; - test::TestLogical>{tuple_c}; - } -} diff --git a/test/integral_constant/orderable.cpp b/test/integral_constant/orderable.cpp deleted file mode 100644 index 6bf06667a..000000000 --- a/test/integral_constant/orderable.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include -#include - -#include -#include -#include -using namespace boost::hana; - - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Setup for the laws below - ////////////////////////////////////////////////////////////////////////// - auto int_constants = tuple_c; - - ////////////////////////////////////////////////////////////////////////// - // Comparable and Orderable - ////////////////////////////////////////////////////////////////////////// - { - // operators - static_assert(has_operator, decltype(equal)>{}, ""); - static_assert(has_operator, decltype(not_equal)>{}, ""); - - static_assert(has_operator, decltype(less)>{}, ""); - static_assert(has_operator, decltype(less_equal)>{}, ""); - static_assert(has_operator, decltype(greater)>{}, ""); - static_assert(has_operator, decltype(greater_equal)>{}, ""); - - // laws - test::TestComparable>{int_constants}; - test::TestOrderable>{int_constants}; - } -} diff --git a/test/string.cpp b/test/string.cpp index 7792ff6f1..ed056fd38 100644 --- a/test/string.cpp +++ b/test/string.cpp @@ -295,6 +295,14 @@ int main() { static_assert(has_operator{}, ""); // laws + auto strings = make( + BOOST_HANA_STRING(""), + BOOST_HANA_STRING("a"), + BOOST_HANA_STRING("ab"), + BOOST_HANA_STRING("abc"), + BOOST_HANA_STRING("ba"), + BOOST_HANA_STRING("abd") + ); test::TestOrderable{strings}; } diff --git a/test/tuple/tuple.cpp b/test/tuple.cpp similarity index 53% rename from test/tuple/tuple.cpp rename to test/tuple.cpp index a3c2a2b8a..536844895 100644 --- a/test/tuple/tuple.cpp +++ b/test/tuple.cpp @@ -8,11 +8,16 @@ Distributed under the Boost Software License, Version 1.0. #include +#include #include #include #include +#include #include +#include +#include #include +#include #include #include @@ -27,9 +32,44 @@ using eq = test::ct_eq; template using ord = test::ct_ord; -struct x0; struct x1; struct x2; struct x3; +struct x0; struct x1; struct x2; struct x3; struct x4; + +template +struct F { struct type; }; int main() { + auto eq_tuples = make( + make() + , make(eq<0>{}) + , make(eq<0>{}, eq<1>{}) + , make(eq<0>{}, eq<1>{}, eq<2>{}) + , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}) + , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}, eq<4>{}) + , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}, eq<4>{}, eq<5>{}) + ); + (void)eq_tuples; + + auto ord_tuples = make( + make() + , make(ord<0>{}) + , make(ord<0>{}, ord<1>{}) + , make(ord<0>{}, ord<1>{}, ord<2>{}) + , make(ord<0>{}, ord<1>{}, ord<2>{}, ord<3>{}) + , make(ord<0>{}, ord<1>{}, ord<2>{}, ord<3>{}, ord<4>{}) + ); + (void)ord_tuples; + + auto nested_eqs = make( + make() + , make(make(eq<0>{})) + , make(make(eq<0>{}), make(eq<1>{}, eq<2>{})) + , make(make(eq<0>{}), + make(eq<1>{}, eq<2>{}), + make(eq<3>{}, eq<4>{})) + ); + (void)nested_eqs; + +#if BOOST_HANA_TEST_PART == 1 ////////////////////////////////////////////////////////////////////////// // Move-only friendliness and reference semantics ////////////////////////////////////////////////////////////////////////// @@ -94,18 +134,41 @@ int main() { } ////////////////////////////////////////////////////////////////////////// - // Setup for the laws below + // Comparable ////////////////////////////////////////////////////////////////////////// - auto eq_tuples = make( - make() - , make(eq<0>{}) - , make(eq<0>{}, eq<1>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}, eq<4>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}, eq<4>{}, eq<5>{}) - ); + { + // equal + // tuple_t + BOOST_HANA_CONSTANT_CHECK(equal(tuple_t<>, tuple_t<>)); + BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_t, tuple_t<>))); + BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_t<>, tuple_t))); + BOOST_HANA_CONSTANT_CHECK(equal(tuple_t, tuple_t)); + BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_t, tuple_t))); + BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_t, tuple_t))); + BOOST_HANA_CONSTANT_CHECK(equal(tuple_t, tuple_t)); + BOOST_HANA_CONSTANT_CHECK(equal(tuple_t, tuple_t)); + + // tuple_c + BOOST_HANA_CONSTANT_CHECK(equal(tuple_c, tuple_c)); + BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_c, tuple_c))); + BOOST_HANA_CONSTANT_CHECK(equal(tuple_c, tuple_c)); + BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_c, tuple_c))); + BOOST_HANA_CONSTANT_CHECK(equal(tuple_c, tuple_c)); + BOOST_HANA_CONSTANT_CHECK(equal(tuple_c, tuple_c)); + + test::TestComparable{eq_tuples}; + } + +#elif BOOST_HANA_TEST_PART == 2 + ////////////////////////////////////////////////////////////////////////// + // Orderable + ////////////////////////////////////////////////////////////////////////// + { + test::TestOrderable{ord_tuples}; + } + +#elif BOOST_HANA_TEST_PART == 3 ////////////////////////////////////////////////////////////////////////// // Foldable ////////////////////////////////////////////////////////////////////////// @@ -158,6 +221,7 @@ int main() { test::TestFoldable{eq_tuples}; } +#elif BOOST_HANA_TEST_PART == 4 ////////////////////////////////////////////////////////////////////////// // Iterable ////////////////////////////////////////////////////////////////////////// @@ -223,10 +287,131 @@ int main() { test::TestTraversable{}; } +#elif BOOST_HANA_TEST_PART == 5 + ////////////////////////////////////////////////////////////////////////// + // Searchable + ////////////////////////////////////////////////////////////////////////// + { + auto eq_tuples = make( + make() + , make(eq<0>{}) + , make(eq<0>{}, eq<1>{}) + , make(eq<0>{}, eq<1>{}, eq<2>{}) + , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}) + , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}, eq<4>{}) + ); + + auto eq_tuple_keys = make(eq<3>{}, eq<5>{}); + test::TestSearchable{eq_tuples, eq_tuple_keys}; + } + +#elif BOOST_HANA_TEST_PART == 6 ////////////////////////////////////////////////////////////////////////// // Sequence ////////////////////////////////////////////////////////////////////////// { test::TestSequence{}; } + +#elif BOOST_HANA_TEST_PART == 7 + ////////////////////////////////////////////////////////////////////////// + // Functor + ////////////////////////////////////////////////////////////////////////// + { + // Test transform with tuple_t and Metafunctions + BOOST_HANA_CONSTANT_CHECK(equal( + transform(tuple_t<>, metafunction), + tuple_t<> + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + transform(tuple_t, metafunction), + tuple_t::type> + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + transform(tuple_t, metafunction), + tuple_t::type, F::type> + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + transform(tuple_t, metafunction), + tuple_t::type, F::type, F::type> + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + transform(tuple_t, metafunction), + tuple_t::type, F::type, F::type, F::type> + )); + + BOOST_HANA_CONSTANT_CHECK(equal( + transform(tuple_t, template_), + tuple_t, F, F, F> + )); + + // laws + auto eq_values = make(eq<0>{}, eq<2>{}); + test::TestFunctor{eq_tuples, eq_values}; + } + + ////////////////////////////////////////////////////////////////////////// + // Applicative + ////////////////////////////////////////////////////////////////////////// + { + test::TestApplicative{}; + } + +#elif BOOST_HANA_TEST_PART == 8 + ////////////////////////////////////////////////////////////////////////// + // Monad + ////////////////////////////////////////////////////////////////////////// + { + test::TestMonad{eq_tuples, nested_eqs}; + } + +#elif BOOST_HANA_TEST_PART == 9 + ////////////////////////////////////////////////////////////////////////// + // MonadPlus + ////////////////////////////////////////////////////////////////////////// + { + // prepend + { + BOOST_HANA_CONSTANT_CHECK(equal( + prepend(long_<0>, tuple_c), + tuple_c + )); + BOOST_HANA_CONSTANT_CHECK(equal( + prepend(uint<0>, tuple_c), + tuple_c + )); + BOOST_HANA_CONSTANT_CHECK(equal( + prepend(llong<0>, tuple_c), + tuple_c + )); + BOOST_HANA_CONSTANT_CHECK(equal( + prepend(ulong<0>, tuple_c), + tuple_c + )); + } + + // empty + { + BOOST_HANA_CONSTANT_CHECK(equal( + empty(), + tuple_c + )); + BOOST_HANA_CONSTANT_CHECK(equal( + empty(), + tuple_c + )); + BOOST_HANA_CONSTANT_CHECK(equal( + empty(), + tuple_c + )); + } + + // laws + test::TestMonadPlus{eq_tuples}; + } +#endif } diff --git a/test/tuple/tuple_t_adl.cpp b/test/tuple.tuple_t_adl.cpp similarity index 100% rename from test/tuple/tuple_t_adl.cpp rename to test/tuple.tuple_t_adl.cpp diff --git a/test/tuple/usability_of_types.cpp b/test/tuple.usability_of_types.cpp similarity index 100% rename from test/tuple/usability_of_types.cpp rename to test/tuple.usability_of_types.cpp diff --git a/test/tuple/monad_plus.cpp b/test/tuple/monad_plus.cpp deleted file mode 100644 index 45323110a..000000000 --- a/test/tuple/monad_plus.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include - -#include -#include -#include -#include -#include -using namespace boost::hana; - - -// This test is in its own file to avoid crashing the compiler. - -template -using eq = test::ct_eq; - -template -struct F { struct type; }; -struct t1; struct t2; struct t3; struct t4; - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Setup for the laws below - ////////////////////////////////////////////////////////////////////////// - auto eq_tuples = make( - make() - , make(eq<0>{}) - , make(eq<0>{}, eq<1>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}, eq<4>{}, eq<5>{}) - ); - - auto eq_values = make(eq<0>{}, eq<2>{}); - - auto eq_tuples_tuples = make( - make() - , make(make(eq<0>{})) - , make(make(eq<0>{}), make(eq<1>{}, eq<2>{})) - , make(make(eq<0>{}), - make(eq<1>{}, eq<2>{}), - make(eq<3>{}, eq<4>{})) - ); - - ////////////////////////////////////////////////////////////////////////// - // Functor - ////////////////////////////////////////////////////////////////////////// - { - // Test transform with tuple_t and Metafunctions - BOOST_HANA_CONSTANT_CHECK(equal( - transform(tuple_t<>, metafunction), - tuple_t<> - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - transform(tuple_t, metafunction), - tuple_t::type> - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - transform(tuple_t, metafunction), - tuple_t::type, F::type> - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - transform(tuple_t, metafunction), - tuple_t::type, F::type, F::type> - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - transform(tuple_t, metafunction), - tuple_t::type, F::type, F::type, F::type> - )); - - BOOST_HANA_CONSTANT_CHECK(equal( - transform(tuple_t, template_), - tuple_t, F, F, F> - )); - - test::TestFunctor{eq_tuples, eq_values}; - } - - ////////////////////////////////////////////////////////////////////////// - // Applicative - ////////////////////////////////////////////////////////////////////////// - { - test::TestApplicative{}; - } - - ////////////////////////////////////////////////////////////////////////// - // Monad - ////////////////////////////////////////////////////////////////////////// - { - test::TestMonad{eq_tuples, eq_tuples_tuples}; - } - - ////////////////////////////////////////////////////////////////////////// - // MonadPlus - ////////////////////////////////////////////////////////////////////////// - { - // prepend - { - BOOST_HANA_CONSTANT_CHECK(equal( - prepend(long_<0>, tuple_c), - tuple_c - )); - BOOST_HANA_CONSTANT_CHECK(equal( - prepend(uint<0>, tuple_c), - tuple_c - )); - BOOST_HANA_CONSTANT_CHECK(equal( - prepend(llong<0>, tuple_c), - tuple_c - )); - BOOST_HANA_CONSTANT_CHECK(equal( - prepend(ulong<0>, tuple_c), - tuple_c - )); - } - - // empty - { - BOOST_HANA_CONSTANT_CHECK(equal( - empty(), - tuple_c - )); - BOOST_HANA_CONSTANT_CHECK(equal( - empty(), - tuple_c - )); - BOOST_HANA_CONSTANT_CHECK(equal( - empty(), - tuple_c - )); - } - - test::TestMonadPlus{eq_tuples}; - } -} diff --git a/test/tuple/orderable.cpp b/test/tuple/orderable.cpp deleted file mode 100644 index 07f350a8c..000000000 --- a/test/tuple/orderable.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include -#include -#include - -#include -#include -using namespace boost::hana; - - -template -using eq = test::ct_eq; - -template -using ord = test::ct_ord; - -struct x0; struct x1; struct x2; struct x3; - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Setup for the laws below - ////////////////////////////////////////////////////////////////////////// - auto eq_tuples = make( - make() - , make(eq<0>{}) - , make(eq<0>{}, eq<1>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}, eq<4>{}) - ); - - auto ord_tuples = make( - make() - , make(ord<0>{}) - , make(ord<0>{}, ord<1>{}) - , make(ord<0>{}, ord<1>{}, ord<2>{}) - , make(ord<0>{}, ord<1>{}, ord<2>{}, ord<3>{}) - , make(ord<0>{}, ord<1>{}, ord<2>{}, ord<3>{}, ord<4>{}) - ); - - ////////////////////////////////////////////////////////////////////////// - // Comparable - ////////////////////////////////////////////////////////////////////////// - { - // equal - - // tuple_t - BOOST_HANA_CONSTANT_CHECK(equal(tuple_t<>, tuple_t<>)); - BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_t, tuple_t<>))); - BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_t<>, tuple_t))); - BOOST_HANA_CONSTANT_CHECK(equal(tuple_t, tuple_t)); - BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_t, tuple_t))); - BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_t, tuple_t))); - BOOST_HANA_CONSTANT_CHECK(equal(tuple_t, tuple_t)); - BOOST_HANA_CONSTANT_CHECK(equal(tuple_t, tuple_t)); - - // tuple_c - BOOST_HANA_CONSTANT_CHECK(equal(tuple_c, tuple_c)); - BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_c, tuple_c))); - BOOST_HANA_CONSTANT_CHECK(equal(tuple_c, tuple_c)); - BOOST_HANA_CONSTANT_CHECK(not_(equal(tuple_c, tuple_c))); - BOOST_HANA_CONSTANT_CHECK(equal(tuple_c, tuple_c)); - BOOST_HANA_CONSTANT_CHECK(equal(tuple_c, tuple_c)); - - test::TestComparable{eq_tuples}; - } - - ////////////////////////////////////////////////////////////////////////// - // Orderable - ////////////////////////////////////////////////////////////////////////// - { - test::TestOrderable{ord_tuples}; - } -} diff --git a/test/tuple/searchable.cpp b/test/tuple/searchable.cpp deleted file mode 100644 index d49a7efef..000000000 --- a/test/tuple/searchable.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* -@copyright Louis Dionne 2015 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - */ - -#include - -#include -#include -using namespace boost::hana; - - -// This test is in its own file to avoid crashing the compiler. - -template -using eq = test::ct_eq; - -int main() { - ////////////////////////////////////////////////////////////////////////// - // Setup for the laws below - ////////////////////////////////////////////////////////////////////////// - auto eq_tuples = make( - make() - , make(eq<0>{}) - , make(eq<0>{}, eq<1>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}) - , make(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}, eq<4>{}, eq<5>{}) - ); - - auto eq_tuple_keys = make(eq<3>{}, eq<5>{}); - - ////////////////////////////////////////////////////////////////////////// - // Searchable - ////////////////////////////////////////////////////////////////////////// - { - test::TestSearchable{eq_tuples, eq_tuple_keys}; - } -} diff --git a/test/type.cpp b/test/type.cpp index d663856d9..684da2290 100644 --- a/test/type.cpp +++ b/test/type.cpp @@ -104,8 +104,6 @@ int main() { // laws auto types = make( - type, - type, type, type, type,