vala r1481 - in trunk: . tests
- From: jhaitsma svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1481 - in trunk: . tests
- Date: Thu, 29 May 2008 10:10:33 +0000 (UTC)
Author: jhaitsma
Date: Thu May 29 10:10:33 2008
New Revision: 1481
URL: http://svn.gnome.org/viewvc/vala?rev=1481&view=rev
Log:
2008-05-29 Jaap A. Haitsma <jaap haitsma org>
* tests/strings.vala:
Add some more tests. Fixes bug #535430
Modified:
trunk/ChangeLog
trunk/tests/strings.vala
Modified: trunk/tests/strings.vala
==============================================================================
--- trunk/tests/strings.vala (original)
+++ trunk/tests/strings.vala Thu May 29 10:10:33 2008
@@ -1,6 +1,45 @@
using GLib;
class Maman.Foo : Object {
+
+ const string[] array_field = {"1", "2"};
+
+ /* Does not work, because of bug 516287
+ static const public string s1_field = "1" + "2";
+ static const string s2_field = "1" + "2";
+
+ */
+ static void test_string_initializers () {
+ /* Does not work yet. bug 530623
+ // Local constant
+ const string s1 = "1";
+ assert (s1 == "1");
+ */
+
+ /* Does not work yet. bug 530623 and bug 516287
+ // Local constant with string concatenation
+ const string s2 = "1" + "2";
+ assert (s2 == "12");
+ */
+
+ // string array
+ string[] array1 = {"1", "2"};
+
+ assert (array1[0] == "1");
+ assert (array1[1] == "2");
+ assert (array1.length == 2);
+
+ // string array field
+ assert (array_field[0] == "1");
+ assert (array_field[1] == "2");
+ assert (array_field.length == 2);
+
+ /* Does not work, because of bug 516287
+ // const field string with concatenation
+ assert (s1_field == "12");
+ assert (s2_field == "12");
+ */
+ }
static void test_string_operators () {
// string == operator compares content not reference
string s1 = "string";
@@ -30,6 +69,7 @@
stdout.printf (" 8\n");
test_string_operators ();
+ test_string_initializers ();
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]