From 3e519524c118651123eecf60c2bbc5d65ad9bac3 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 11 May 2010 19:42:16 +0000 Subject: libcxx initial import llvm-svn: 103490 --- .../string::oplt=/string_string.pass.cpp | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 libcxx/test/strings/basic.string/string.nonmembers/string::oplt=/string_string.pass.cpp (limited to 'libcxx/test/strings/basic.string/string.nonmembers/string::oplt=/string_string.pass.cpp') diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string::oplt=/string_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string::oplt=/string_string.pass.cpp new file mode 100644 index 00000000000..28e0c9ca060 --- /dev/null +++ b/libcxx/test/strings/basic.string/string.nonmembers/string::oplt=/string_string.pass.cpp @@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// bool operator<=(const basic_string& lhs, +// const basic_string& rhs); + +#include +#include + +template +void +test(const S& lhs, const S& rhs, bool x) +{ + assert((lhs <= rhs) == x); +} + +typedef std::string S; + +int main() +{ + test(S(""), S(""), true); + test(S(""), S("abcde"), true); + test(S(""), S("abcdefghij"), true); + test(S(""), S("abcdefghijklmnopqrst"), true); + test(S("abcde"), S(""), false); + test(S("abcde"), S("abcde"), true); + test(S("abcde"), S("abcdefghij"), true); + test(S("abcde"), S("abcdefghijklmnopqrst"), true); + test(S("abcdefghij"), S(""), false); + test(S("abcdefghij"), S("abcde"), false); + test(S("abcdefghij"), S("abcdefghij"), true); + test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true); + test(S("abcdefghijklmnopqrst"), S(""), false); + test(S("abcdefghijklmnopqrst"), S("abcde"), false); + test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false); + test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true); +} -- cgit v1.2.3