about summary refs log tree commit diff
path: root/src/test/run-pass/string-self-append.rs
blob: 532b3afcbb7d9d72d4971bc56a511356b3b2ebb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// xfail-stage0

use std;
import std::str;

fn main()
{
    // Make sure we properly handle repeated self-appends.
    let str a = "A";
    auto i = 20;
    auto expected_len = 1u;
    while (i > 0) {
        log_err str::byte_len(a);
        assert (str::byte_len(a) == expected_len);
        a += a;
        i -= 1;
        expected_len *= 2u;
    }
}