Skip to content

Commit f971929

Browse files
committed
---
yaml --- r: 5103 b: refs/heads/master c: 5ebe61c h: refs/heads/master i: 5101: cf3875c 5099: 13e25bf 5095: bdd681d 5087: 289d39d v: v3
1 parent 6dcc614 commit f971929

File tree

5 files changed

+29
-42
lines changed

5 files changed

+29
-42
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: d0c509ad1b8a13102e7cb6ba2bf1d2dc75e5177e
2+
refs/heads/master: 5ebe61cdda1349ed1a79d39bb41f8d812d38a216

trunk/src/test/stdtest/stdtest.rc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ mod rand;
2424
mod run;
2525
mod sha1;
2626
mod sort;
27-
mod str_buf;
2827
mod str;
2928
mod task;
3029
mod test;
3130
mod uint;
32-
mod vec_str_conversions;
3331

3432
// Local Variables:
3533
// mode: rust

trunk/src/test/stdtest/str.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,31 @@ fn as_buf_small() {
285285
});
286286
assert b == 100;
287287
}
288+
289+
#[test]
290+
fn as_buf2() {
291+
let s = ~"hello";
292+
let sb = istr::as_buf(s, { |b| b });
293+
let s_cstr = istr::str_from_cstr(sb);
294+
assert (istr::eq(s_cstr, s));
295+
}
296+
297+
#[test]
298+
fn vec_str_conversions() {
299+
let s1: istr = ~"All mimsy were the borogoves";
300+
301+
let v: [u8] = istr::bytes(s1);
302+
let s2: istr = istr::unsafe_from_bytes(v);
303+
let i: uint = 0u;
304+
let n1: uint = istr::byte_len(s1);
305+
let n2: uint = vec::len::<u8>(v);
306+
assert (n1 == n2);
307+
while i < n1 {
308+
let a: u8 = s1[i];
309+
let b: u8 = s2[i];
310+
log a;
311+
log b;
312+
assert (a == b);
313+
i += 1u;
314+
}
315+
}

trunk/src/test/stdtest/str_buf.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

trunk/src/test/stdtest/vec_str_conversions.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)