Home | History | Annotate | Download | only in string_opgt
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <string>
     11 
     12 // template<class charT, class traits, class Allocator>
     13 //   bool operator>(const basic_string<charT,traits,Allocator>& lhs,
     14 //                  const basic_string<charT,traits,Allocator>& rhs);
     15 
     16 #include <string>
     17 #include <cassert>
     18 
     19 template <class S>
     20 void
     21 test(const S& lhs, const S& rhs, bool x)
     22 {
     23     assert((lhs > rhs) == x);
     24 }
     25 
     26 typedef std::string S;
     27 
     28 int main()
     29 {
     30     test(S(""), S(""), false);
     31     test(S(""), S("abcde"), false);
     32     test(S(""), S("abcdefghij"), false);
     33     test(S(""), S("abcdefghijklmnopqrst"), false);
     34     test(S("abcde"), S(""), true);
     35     test(S("abcde"), S("abcde"), false);
     36     test(S("abcde"), S("abcdefghij"), false);
     37     test(S("abcde"), S("abcdefghijklmnopqrst"), false);
     38     test(S("abcdefghij"), S(""), true);
     39     test(S("abcdefghij"), S("abcde"), true);
     40     test(S("abcdefghij"), S("abcdefghij"), false);
     41     test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false);
     42     test(S("abcdefghijklmnopqrst"), S(""), true);
     43     test(S("abcdefghijklmnopqrst"), S("abcde"), true);
     44     test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true);
     45     test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
     46 }
     47