[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:
Stephan T. Lavavej
2016-11-23 22:03:28 +00:00
parent 39245fe351
commit e33c0b01f8
58 changed files with 91 additions and 91 deletions

View File

@@ -10,7 +10,7 @@
// <string>
// template<class _Tp>
// basic_string(const _Tp& __t, size_type __pos, size_type __n,
// basic_string(const _Tp& __t, size_type __pos, size_type __n,
// const allocator_type& __a = allocator_type());
//
// Mostly we're testing string_view here

View File

@@ -183,14 +183,14 @@ int main()
typedef std::string S;
S s_short = "123/";
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
s_short.append(s_short.begin(), s_short.end());
assert(s_short == "123/123/");
s_short.append(s_short.begin(), s_short.end());
assert(s_short == "123/123/123/123/");
s_short.append(s_short.begin(), s_short.end());
assert(s_short == "123/123/123/123/123/123/123/123/");
s_long.append(s_long.begin(), s_long.end());
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
}

View File

@@ -66,14 +66,14 @@ int main()
typedef std::string S;
S s_short = "123/";
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
s_short.append(s_short.c_str());
assert(s_short == "123/123/");
s_short.append(s_short.c_str());
assert(s_short == "123/123/123/123/");
s_short.append(s_short.c_str());
assert(s_short == "123/123/123/123/123/123/123/123/");
s_long.append(s_long.c_str());
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
}

View File

@@ -75,14 +75,14 @@ int main()
typedef std::string S;
S s_short = "123/";
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
s_short.append(s_short.data(), s_short.size());
assert(s_short == "123/123/");
s_short.append(s_short.data(), s_short.size());
assert(s_short == "123/123/123/123/");
s_short.append(s_short.data(), s_short.size());
assert(s_short == "123/123/123/123/123/123/123/123/");
s_long.append(s_long.data(), s_long.size());
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
}

View File

@@ -184,12 +184,12 @@ int main()
typedef std::string S;
S s_short = "123/";
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
s_short.assign(s_short.begin(), s_short.end());
assert(s_short == "123/");
s_short.assign(s_short.begin() + 2, s_short.end());
assert(s_short == "3/");
s_long.assign(s_long.begin(), s_long.end());
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/");

View File

@@ -66,12 +66,12 @@ int main()
typedef std::string S;
S s_short = "123/";
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
s_short.assign(s_short.c_str());
assert(s_short == "123/");
s_short.assign(s_short.c_str() + 2);
assert(s_short == "3/");
s_long.assign(s_long.c_str() + 30);
assert(s_long == "nsectetur/");
}

View File

@@ -74,12 +74,12 @@ int main()
typedef std::string S;
S s_short = "123/";
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
s_short.assign(s_short.data(), s_short.size());
assert(s_short == "123/");
s_short.assign(s_short.data() + 2, s_short.size() - 2);
assert(s_short == "3/");
s_long.assign(s_long.data(), s_long.size());
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/");

View File

@@ -174,14 +174,14 @@ int main()
typedef std::string S;
S s_short = "123/";
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
s_short.insert(s_short.begin(), s_short.begin(), s_short.end());
assert(s_short == "123/123/");
s_short.insert(s_short.begin(), s_short.begin(), s_short.end());
assert(s_short == "123/123/123/123/");
s_short.insert(s_short.begin(), s_short.begin(), s_short.end());
assert(s_short == "123/123/123/123/123/123/123/123/");
s_long.insert(s_long.begin(), s_long.begin(), s_long.end());
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
}

View File

@@ -1822,7 +1822,7 @@ int main()
s.insert(0, sv, 0); // calls insert(T, pos, npos)
assert(s == sv);
s.clear();
s.insert(0, sv, 0, std::string::npos); // calls insert(T, pos, npos)
assert(s == sv);
s.clear();

View File

@@ -223,14 +223,14 @@ int main()
typedef std::string S;
S s_short = "123/";
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
s_short.insert(0, s_short.c_str());
assert(s_short == "123/123/");
s_short.insert(0, s_short.c_str());
assert(s_short == "123/123/123/123/");
s_short.insert(0, s_short.c_str());
assert(s_short == "123/123/123/123/123/123/123/123/");
s_long.insert(0, s_long.c_str());
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
}

View File

@@ -704,14 +704,14 @@ int main()
typedef std::string S;
S s_short = "123/";
S s_long = "Lorem ipsum dolor sit amet, consectetur/";
s_short.insert(0, s_short.data(), s_short.size());
assert(s_short == "123/123/");
s_short.insert(0, s_short.data(), s_short.size());
assert(s_short == "123/123/123/123/");
s_short.insert(0, s_short.data(), s_short.size());
assert(s_short == "123/123/123/123/123/123/123/123/");
s_long.insert(0, s_long.data(), s_long.size());
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
}

View File

@@ -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/");
}

View File

@@ -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/");
}

View File

@@ -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/");
}

View File

@@ -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

View File

@@ -10,7 +10,7 @@
// <string>
// we get this comparison "for free" because the string implicitly converts to the string_view
#include <string>
#include <cassert>