ropes: Removed useless dump_buffer in to_s
authorLucas Bajolet <r4pass@hotmail.com>
Fri, 31 Jul 2015 14:16:32 +0000 (10:16 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Fri, 31 Jul 2015 14:16:32 +0000 (10:16 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/standard/text/ropes.nit
tests/niti.skip
tests/nitvm.skip
tests/test_ropebuffer.nit [new file with mode: 0644]

index 018217e..4018339 100644 (file)
@@ -449,7 +449,8 @@ class RopeBuffer
        redef fun enlarge(i) do end
 
        redef fun to_s do
-               dump_buffer
+               persist_buffer
+               written = true
                return str
        end
 
index 9718dc3..ad78ced 100644 (file)
@@ -29,3 +29,4 @@ input
 first_letter_last_letter
 fibonacci_word
 shootout_nsieve
+test_ropebuffer
index 9718dc3..ad78ced 100644 (file)
@@ -29,3 +29,4 @@ input
 first_letter_last_letter
 fibonacci_word
 shootout_nsieve
+test_ropebuffer
diff --git a/tests/test_ropebuffer.nit b/tests/test_ropebuffer.nit
new file mode 100644 (file)
index 0000000..aa21a5e
--- /dev/null
@@ -0,0 +1,20 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+var rb = new RopeBuffer
+
+for i in [0 .. 1000000[ do
+       rb.add 'S'
+       var s = rb.to_s
+end