D-Bus: Fix Connection.get_proxy.begin calls
[vala-lang.git] / tests / basic-types / strings.vala
blobbb27a61e969c57eb7ccd30a8a60cbf9a467134b8
1 void test_string () {
2 // declaration and initialization
3 string s = "hello";
4 assert (s == "hello");
6 // assignment
7 s = "world";
8 assert (s == "world");
10 // access
11 string t = s;
12 assert (t == "world");
14 // +
15 s = "hello" + "world";
16 assert (s == "helloworld");
18 // equality and relational
19 s = "hello";
20 assert (s == "hello");
21 assert (s != "world");
22 assert (s < "i");
23 assert (!(s < "g"));
24 assert (s <= "hello");
25 assert (!(s <= "g"));
26 assert (s >= "hello");
27 assert (!(s >= "i"));
28 assert (s > "g");
29 assert (!(s > "i"));
31 // slices
32 t = s[2:4];
33 assert (t.length == 2);
34 assert (t[0] == 'l');
35 assert (t[1] == 'l');
38 void main () {
39 test_string ();