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(""), "", false, false);
34 test(S(""), "abcde", true, false);
35 test(S(""), "abcdefghij", true, false);
36 test(S(""), "abcdefghijklmnopqrst", true, false);
37 test(S("abcde"), "", false, true);
38 test(S("abcde"), "abcde", false, false);
39 test(S("abcde"), "abcdefghij", true, false);
40 test(S("abcde"), "abcdefghijklmnopqrst", true, false);
41 test(S("abcdefghij"), "", false, true);
42 test(S("abcdefghij"), "abcde", false, true);
43 test(S("abcdefghij"), "abcdefghij", false, false);
44 test(S("abcdefghij"), "abcdefghijklmnopqrst", true, false);
45 test(S("abcdefghijklmnopqrst"), "", false, true);
46 test(S("abcdefghijklmnopqrst"), "abcde", false, true);
47 test(S("abcdefghijklmnopqrst"), "abcdefghij", false, true);
48 test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false, false);