2011-06-27 13:41:16 -05:00
|
|
|
use std;
|
2011-12-13 18:25:51 -06:00
|
|
|
import str;
|
2011-06-27 13:41:16 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn main() {
|
2011-06-27 13:41:16 -05:00
|
|
|
// Make sure we properly handle repeated self-appends.
|
2012-07-14 00:57:48 -05:00
|
|
|
let mut a: ~str = ~"A";
|
2012-03-22 10:39:41 -05:00
|
|
|
let mut i = 20;
|
|
|
|
let mut expected_len = 1u;
|
2011-07-27 07:19:39 -05:00
|
|
|
while i > 0 {
|
2012-02-23 03:44:04 -06:00
|
|
|
log(error, str::len(a));
|
|
|
|
assert (str::len(a) == expected_len);
|
2011-06-27 13:41:16 -05:00
|
|
|
a += a;
|
|
|
|
i -= 1;
|
|
|
|
expected_len *= 2u;
|
|
|
|
}
|
2011-08-19 17:16:48 -05:00
|
|
|
}
|