We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc1316a commit 7bfe4dbCopy full SHA for 7bfe4db
src/test/stdtest/rope.rs
@@ -2,6 +2,7 @@ import std::str;
2
import std::rope::*;
3
import std::option;
4
import std::uint;
5
+import std::vec;
6
7
//Utility function, used for sanity check
8
fn rope_to_string(r: rope) -> str {
@@ -146,3 +147,18 @@ fn char_at1() {
146
147
assert eq(r2, r3);
148
assert eq(bal2, bal3);
149
}
150
+
151
+#[test]
152
+fn concat1() {
153
+ //Generate a reasonable rope
154
+ let chunk = of_str(@ "123456789");
155
+ let r = empty();
156
+ uint::range(0u, 10u){|_i|
157
+ r = append_rope(r, chunk);
158
+ }
159
160
+ //Same rope, obtained with rope::concat
161
+ let r2 = concat(vec::init_elt(chunk, 10u));
162
163
+ assert eq(r, r2);
164
+}
0 commit comments