This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] More assign tests
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 16 Dec 2001 21:30:16 +0100
- Subject: [v3] More assign tests
Hi,
I have just committed the following small patch. Approved by Benjamin Kosnik and
Nathan Myers.
Cheers,
Paolo.
///////////////
2001-12-16 Paolo Carlini <pcarlini@unitus.it>
* testsuite/21_strings/assign.cc (test01): New tests.
--- assign.cc.orig Sun Dec 16 12:04:30 2001
+++ assign.cc Sun Dec 16 12:45:56 2001
@@ -37,6 +37,13 @@ test01()
if (i != string::npos)
aux.assign(aux, i + 1, string::npos);
VERIFY(aux == "Hawaii");
+
+ aux = strlit;
+ i = aux.rfind("r/");
+ if (i != string::npos)
+ aux.assign(aux, i + 1, string::npos);
+ VERIFY (aux.c_str()[9] == 'B');
+ VERIFY (aux == "/Hanalei Bay/Kauai/Hawaii");
}
// assign(const basic_string& __str, size_type __pos, size_type __n)