This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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)





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]