mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 01:18:52 +08:00
[libcxx] [test] D27027: Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1012,14 +1012,14 @@ int main()
|
||||
typedef std::string S;
|
||||
S s_short = "123/";
|
||||
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
|
||||
|
||||
|
||||
s_short.replace(s_short.begin(), s_short.begin(), s_short.begin(), s_short.end());
|
||||
assert(s_short == "123/123/");
|
||||
s_short.replace(s_short.begin(), s_short.begin(), s_short.begin(), s_short.end());
|
||||
assert(s_short == "123/123/123/123/");
|
||||
s_short.replace(s_short.begin(), s_short.begin(), s_short.begin(), s_short.end());
|
||||
assert(s_short == "123/123/123/123/123/123/123/123/");
|
||||
|
||||
|
||||
s_long.replace(s_long.begin(), s_long.begin(), s_long.begin(), s_long.end());
|
||||
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
|
||||
}
|
||||
|
||||
@@ -287,14 +287,14 @@ int main()
|
||||
typedef std::string S;
|
||||
S s_short = "123/";
|
||||
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
|
||||
|
||||
|
||||
s_short.replace(s_short.begin(), s_short.begin(), s_short.c_str());
|
||||
assert(s_short == "123/123/");
|
||||
s_short.replace(s_short.begin(), s_short.begin(), s_short.c_str());
|
||||
assert(s_short == "123/123/123/123/");
|
||||
s_short.replace(s_short.begin(), s_short.begin(), s_short.c_str());
|
||||
assert(s_short == "123/123/123/123/123/123/123/123/");
|
||||
|
||||
|
||||
s_long.replace(s_long.begin(), s_long.begin(), s_long.c_str());
|
||||
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
|
||||
}
|
||||
|
||||
@@ -977,14 +977,14 @@ int main()
|
||||
typedef std::string S;
|
||||
S s_short = "123/";
|
||||
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
|
||||
|
||||
|
||||
s_short.replace(s_short.begin(), s_short.begin(), s_short.data(), s_short.size());
|
||||
assert(s_short == "123/123/");
|
||||
s_short.replace(s_short.begin(), s_short.begin(), s_short.data(), s_short.size());
|
||||
assert(s_short == "123/123/123/123/");
|
||||
s_short.replace(s_short.begin(), s_short.begin(), s_short.data(), s_short.size());
|
||||
assert(s_short == "123/123/123/123/123/123/123/123/");
|
||||
|
||||
|
||||
s_long.replace(s_long.begin(), s_long.begin(), s_long.data(), s_long.size());
|
||||
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// <string>
|
||||
|
||||
// template <class T>
|
||||
// basic_string& replace(size_type pos1, size_type n1, const T& t,
|
||||
// basic_string& replace(size_type pos1, size_type n1, const T& t,
|
||||
// size_type pos2, size_type n=npos);
|
||||
//
|
||||
// Mostly we're testing string_view here
|
||||
|
||||
Reference in New Issue
Block a user