about summary refs log tree commit diff
path: root/src/test/run-pass/str-append.rs
blob: 4e117c4baa22819e95ac0ce75395b33a2a3f51fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26


// -*- rust -*-
use std;
import str;

fn test1() {
    let s: str = "hello";
    s += "world";
    log s;
    assert (s[9] == 'd' as u8);
}

fn test2() {
    // This tests for issue #163

    let ff: str = "abc";
    let a: str = ff + "ABC" + ff;
    let b: str = "ABC" + ff + "ABC";
    log a;
    log b;
    assert (str::eq(a, "abcABCabc"));
    assert (str::eq(b, "ABCabcABC"));
}

fn main() { test1(); test2(); }