2011-06-27 11:41:16 -07:00
|
|
|
// xfail-stage0
|
|
|
|
|
|
|
|
use std;
|
|
|
|
import std::str;
|
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
fn main() {
|
2011-06-27 11:41:16 -07:00
|
|
|
// Make sure we properly handle repeated self-appends.
|
2011-07-27 14:19:39 +02:00
|
|
|
let a: str = "A";
|
|
|
|
let i = 20;
|
|
|
|
let expected_len = 1u;
|
|
|
|
while i > 0 {
|
2011-06-27 11:41:16 -07:00
|
|
|
log_err str::byte_len(a);
|
|
|
|
assert (str::byte_len(a) == expected_len);
|
|
|
|
a += a;
|
|
|
|
i -= 1;
|
|
|
|
expected_len *= 2u;
|
|
|
|
}
|
2011-07-27 14:19:39 +02:00
|
|
|
}
|