]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
test enums update
authorJürg Billeter <j@bitron.ch>
Mon, 26 Feb 2007 22:27:22 +0000 (22:27 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Mon, 26 Feb 2007 22:27:22 +0000 (22:27 +0000)
2007-02-26  Jürg Billeter  <j@bitron.ch>

* tests/test-028.vala, tests/test-028.out: test enums
* tests/Makefile.am: update

svn path=/trunk/; revision=200

vala/ChangeLog
vala/tests/Makefile.am
vala/tests/test-028.out [new file with mode: 0644]
vala/tests/test-028.vala [new file with mode: 0644]

index 87d66345236b2b4504f691d408f5b03e69ac467e..c3aa507f96b8dbe93dd77f07f66cf375e736e088 100644 (file)
@@ -1,3 +1,8 @@
+2007-02-26  Jürg Billeter  <j@bitron.ch>
+
+       * tests/test-028.vala, tests/test-028.out: test enums
+       * tests/Makefile.am: update
+
 2007-02-26  Jürg Billeter  <j@bitron.ch>
 
        * tests/test-027.vala, tests/test-027.out: test postfix and prefix
index ca342fd685ead2dc1661db2559b6f6a34c6433cb..d8d4924d44f978aa77aab8a2caf7c290644edbd7 100644 (file)
@@ -30,6 +30,7 @@ TESTS = \
        test-025.vala \
        test-026.vala \
        test-027.vala \
+       test-028.vala \
        $(NULL)
 
 EXTRA_DIST = \
@@ -62,4 +63,5 @@ EXTRA_DIST = \
        test-025.out \
        test-026.out \
        test-027.out \
+       test-028.out \
        $(NULL)
diff --git a/vala/tests/test-028.out b/vala/tests/test-028.out
new file mode 100644 (file)
index 0000000..d39e190
--- /dev/null
@@ -0,0 +1 @@
+Enum Test: 1 2 3 4 5 6
diff --git a/vala/tests/test-028.vala b/vala/tests/test-028.vala
new file mode 100644 (file)
index 0000000..1047e46
--- /dev/null
@@ -0,0 +1,30 @@
+using GLib;
+
+enum Maman.Foo {
+       VAL2 = 2,
+       VAL3,
+       VAL5 = 5
+}
+
+class Maman.Bar {
+       public void run () {
+               stdout.printf (" %d", Foo.VAL2);
+
+               stdout.printf (" %d", Foo.VAL3);
+
+               stdout.printf (" 4");
+               
+               stdout.printf (" %d", Foo.VAL5);
+       }
+
+       static int main (string[] args) {
+               stdout.printf ("Enum Test: 1");
+               
+               var bar = new Bar ();
+               bar.run ();
+
+               stdout.printf (" 6\n");
+               
+               return 0;
+       }
+}