1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // template<class charT, class traits, class Allocator>
12 // bool operator!=(const basic_string<charT, traits, Allocator> &lhs, basic_string_view<charT,traits> rhs);
13 // template<class charT, class traits, class Allocator>
14 // bool operator!=(basic_string_view<charT,traits> lhs, const basic_string<charT, traits, Allocator> &rhs);
16 #include <string_view>
20 #include "test_macros.h"
24 test(const std::string
&lhs
, S rhs
, bool x
)
26 assert((lhs
!= rhs
) == x
);
27 assert((rhs
!= lhs
) == x
);
33 typedef std::string_view S
;
34 test("", S(""), false);
35 test("", S("abcde"), true);
36 test("", S("abcdefghij"), true);
37 test("", S("abcdefghijklmnopqrst"), true);
38 test("abcde", S(""), true);
39 test("abcde", S("abcde"), false);
40 test("abcde", S("abcdefghij"), true);
41 test("abcde", S("abcdefghijklmnopqrst"), true);
42 test("abcdefghij", S(""), true);
43 test("abcdefghij", S("abcde"), true);
44 test("abcdefghij", S("abcdefghij"), false);
45 test("abcdefghij", S("abcdefghijklmnopqrst"), true);
46 test("abcdefghijklmnopqrst", S(""), true);
47 test("abcdefghijklmnopqrst", S("abcde"), true);
48 test("abcdefghijklmnopqrst", S("abcdefghij"), true);
49 test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false);