1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template<class charT, class traits, class Allocator>
13 // bool operator>=(const basic_string<charT,traits,Allocator>& lhs,
14 // basic_string_view<charT,traits> rhs);
15 // bool operator>=(basic_string_view<charT,traits> lhs,
16 // const basic_string<charT,traits,Allocator>& rhs);
18 #include <experimental/string_view>
23 test(const S& lhs, const typename S::value_type* rhs, bool x, bool y)
25 assert((lhs >= rhs) == x);
26 assert((rhs >= lhs) == y);
32 typedef std::experimental::string_view S;
33 test(S(""), "", true, true);
34 test(S(""), "abcde", false, true);
35 test(S(""), "abcdefghij", false, true);
36 test(S(""), "abcdefghijklmnopqrst", false, true);
37 test(S("abcde"), "", true, false);
38 test(S("abcde"), "abcde", true, true);
39 test(S("abcde"), "abcdefghij", false, true);
40 test(S("abcde"), "abcdefghijklmnopqrst", false, true);
41 test(S("abcdefghij"), "", true, false);
42 test(S("abcdefghij"), "abcde", true, false);
43 test(S("abcdefghij"), "abcdefghij", true, true);
44 test(S("abcdefghij"), "abcdefghijklmnopqrst", false, true);
45 test(S("abcdefghijklmnopqrst"), "", true, false);
46 test(S("abcdefghijklmnopqrst"), "abcde", true, false);
47 test(S("abcdefghijklmnopqrst"), "abcdefghij", true, false);
48 test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true, true);