Skip to content

Commit ac08cf0

Browse files
author
David Rajchenbach-Teller
committed
---
yaml --- r: 6173 b: refs/heads/master c: 7bfe4db h: refs/heads/master i: 6171: a52565c v: v3
1 parent 21a77a2 commit ac08cf0

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: bc1316aaf4f2609b6f8542242d9c3ca65d0853bd
2+
refs/heads/master: 7bfe4dba807ae908a247a34a4f72d0b610e6376f

trunk/src/test/stdtest/rope.rs

+16
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import std::str;
22
import std::rope::*;
33
import std::option;
44
import std::uint;
5+
import std::vec;
56

67
//Utility function, used for sanity check
78
fn rope_to_string(r: rope) -> str {
@@ -146,3 +147,18 @@ fn char_at1() {
146147
assert eq(r2, r3);
147148
assert eq(bal2, bal3);
148149
}
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

Comments
 (0)