]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/string/laws.cpp
1 // Copyright Louis Dionne 2013-2016
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
5 #include <boost/hana/string.hpp>
6 #include <boost/hana/tuple.hpp>
8 #include <laws/comparable.hpp>
9 #include <laws/foldable.hpp>
10 #include <laws/hashable.hpp>
11 #include <laws/iterable.hpp>
12 #include <laws/orderable.hpp>
13 #include <laws/searchable.hpp>
14 namespace hana
= boost::hana
;
18 // Comparable and Hashable
20 auto strings
= hana::make_tuple(
21 BOOST_HANA_STRING(""),
22 BOOST_HANA_STRING("a"),
23 BOOST_HANA_STRING("ab"),
24 BOOST_HANA_STRING("abc"),
25 BOOST_HANA_STRING("abcd"),
26 BOOST_HANA_STRING("abcde"),
27 BOOST_HANA_STRING("ba")
30 hana::test::TestComparable
<hana::string_tag
>{strings
};
31 hana::test::TestHashable
<hana::string_tag
>{strings
};
34 // Foldable and Iterable
36 auto strings
= hana::make_tuple(
37 BOOST_HANA_STRING(""),
38 BOOST_HANA_STRING("a"),
39 BOOST_HANA_STRING("ab"),
40 BOOST_HANA_STRING("abc"),
41 BOOST_HANA_STRING("abcd"),
42 BOOST_HANA_STRING("abcde"),
43 BOOST_HANA_STRING("ba"),
44 BOOST_HANA_STRING("afcd")
47 hana::test::TestFoldable
<hana::string_tag
>{strings
};
48 hana::test::TestIterable
<hana::string_tag
>{strings
};
53 auto strings
= hana::make_tuple(
54 BOOST_HANA_STRING(""),
55 BOOST_HANA_STRING("a"),
56 BOOST_HANA_STRING("ab"),
57 BOOST_HANA_STRING("abc"),
58 BOOST_HANA_STRING("ba"),
59 BOOST_HANA_STRING("abd")
62 hana::test::TestOrderable
<hana::string_tag
>{strings
};
67 auto keys
= hana::tuple_c
<char, 'a', 'f'>;
68 auto strings
= hana::make_tuple(
69 BOOST_HANA_STRING(""),
70 BOOST_HANA_STRING("a"),
71 BOOST_HANA_STRING("ab"),
72 BOOST_HANA_STRING("abcd"),
73 BOOST_HANA_STRING("ba"),
74 BOOST_HANA_STRING("afcd")
77 hana::test::TestSearchable
<hana::string_tag
>{strings
, keys
};