2011-06-27 11:41:16 -07:00
|
|
|
use std;
|
|
|
|
|
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.
|
2012-07-13 22:57:48 -07:00
|
|
|
let mut a: ~str = ~"A";
|
2012-03-22 08:39:41 -07:00
|
|
|
let mut i = 20;
|
|
|
|
let mut expected_len = 1u;
|
2011-07-27 14:19:39 +02:00
|
|
|
while i > 0 {
|
2012-02-23 01:44:04 -08:00
|
|
|
log(error, str::len(a));
|
|
|
|
assert (str::len(a) == expected_len);
|
2011-06-27 11:41:16 -07:00
|
|
|
a += a;
|
|
|
|
i -= 1;
|
|
|
|
expected_len *= 2u;
|
|
|
|
}
|
2011-08-19 15:16:48 -07:00
|
|
|
}
|