refactor tests to have more descriptive names
authorJuerg Billeter <j@bitron.ch>
Thu, 29 Nov 2007 15:14:16 +0000 (15:14 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Thu, 29 Nov 2007 15:14:16 +0000 (15:14 +0000)
2007-11-29  Juerg Billeter  <j@bitron.ch>

* tests/: refactor tests to have more descriptive names

svn path=/trunk/; revision=738

49 files changed:
ChangeLog
tests/Makefile.am
tests/classes-fields.exp [moved from tests/test-008.exp with 100% similarity]
tests/classes-fields.vala [moved from tests/test-008.vala with 100% similarity]
tests/classes-methods.exp [new file with mode: 0644]
tests/classes-methods.vala [new file with mode: 0644]
tests/classes-properties.exp [moved from tests/property-sample.exp with 82% similarity]
tests/classes-properties.vala [moved from tests/property-sample.vala with 54% similarity]
tests/classes-signals.exp [moved from tests/test-018.exp with 53% similarity]
tests/classes-signals.vala [moved from tests/test-018.vala with 61% similarity]
tests/delegates.exp [moved from tests/test-014.exp with 100% similarity]
tests/delegates.vala [moved from tests/test-014.vala with 100% similarity]
tests/enums.exp [moved from tests/test-028.exp with 100% similarity]
tests/enums.vala [moved from tests/test-028.vala with 100% similarity]
tests/exceptions.exp [moved from tests/test-033.exp with 100% similarity]
tests/exceptions.vala [moved from tests/test-033.vala with 100% similarity]
tests/expressions-assignments.exp [moved from tests/test-010.exp with 100% similarity]
tests/expressions-assignments.vala [moved from tests/test-010.vala with 100% similarity]
tests/expressions-conditional.exp [moved from tests/test-016.exp with 100% similarity]
tests/expressions-conditional.vala [moved from tests/test-016.vala with 100% similarity]
tests/expressions-relational.exp [moved from tests/test-011.exp with 100% similarity]
tests/expressions-relational.vala [moved from tests/test-011.vala with 100% similarity]
tests/interfaces.exp [moved from tests/test-017.exp with 100% similarity]
tests/interfaces.vala [moved from tests/test-017.vala with 100% similarity]
tests/namespaces.exp [moved from tests/test-002.exp with 61% similarity]
tests/namespaces.vala [new file with mode: 0644]
tests/statements-jump.exp [moved from tests/test-013.exp with 100% similarity]
tests/statements-jump.vala [moved from tests/test-013.vala with 100% similarity]
tests/statements-selection.exp [moved from tests/test-020.exp with 57% similarity]
tests/statements-selection.vala [moved from tests/test-020.vala with 83% similarity]
tests/test-001.exp [deleted file]
tests/test-001.vala [deleted file]
tests/test-002.vala [deleted file]
tests/test-003.exp [deleted file]
tests/test-003.vala [deleted file]
tests/test-004.exp [deleted file]
tests/test-004.vala [deleted file]
tests/test-005.exp [deleted file]
tests/test-005.vala [deleted file]
tests/test-006.exp [deleted file]
tests/test-006.vala [deleted file]
tests/test-007.exp [deleted file]
tests/test-007.vala [deleted file]
tests/test-009.exp [deleted file]
tests/test-009.vala [deleted file]
tests/test-012.exp [deleted file]
tests/test-012.vala [deleted file]
tests/test-024.exp [deleted file]
tests/test-024.vala [deleted file]

index ae886d8..9f9748b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-11-29  Jürg Billeter  <j@bitron.ch>
 
+       * tests/: refactor tests to have more descriptive names
+
+2007-11-29  Jürg Billeter  <j@bitron.ch>
+
        * configure.ac, tests/Makefile.am, tests/testenchant.vala: remove
          enchant bindings test, we focus on compiler tests
 
index a586fc1..0f5ddaf 100644 (file)
@@ -16,43 +16,35 @@ TESTS_ENVIRONMENT = $(srcdir)/testrunner.sh
 
 TESTS = \
        hello.vala \
+       expressions-relational.vala \
+       expressions-conditional.vala \
+       expressions-assignments.vala \
+       statements-selection.vala \
+       statements-jump.vala \
+       namespaces.vala \
        classes.vala \
+       classes-fields.vala \
+       classes-methods.vala \
+       classes-properties.vala \
+       classes-signals.vala \
        structs.vala \
-       property-sample.vala \
+       interfaces.vala \
+       enums.vala \
+       delegates.vala \
+       exceptions.vala \
        \
-       test-001.vala \
-       test-002.vala \
-       test-003.vala \
-       test-004.vala \
-       test-005.vala \
-       test-006.vala \
-       test-007.vala \
-       test-008.vala \
-       test-009.vala \
-       test-010.vala \
-       test-011.vala \
-       test-012.vala \
-       test-013.vala \
-       test-014.vala \
        test-015.vala \
-       test-016.vala \
-       test-017.vala \
-       test-018.vala \
        test-019.vala \
-       test-020.vala \
        test-021.vala \
        test-022.vala \
        test-023.vala \
-       test-024.vala \
        test-025.vala \
        test-026.vala \
        test-027.vala \
-       test-028.vala \
        test-029.vala \
        test-030.vala \
        test-031.vala \
        test-032.vala \
-       test-033.vala \
        test-034.vala \
        test-035.vala \
        test-036.vala \
@@ -64,43 +56,35 @@ EXTRA_DIST = \
        $(TESTS) \
        \
        hello.exp \
+       expressions-relational.exp \
+       expressions-conditional.vala \
+       expressions-assignments.exp \
+       statements-selection.exp \
+       statements-jump.exp \
+       namespaces.exp \
        classes.exp \
+       classes-fields.exp \
+       classes-methods.exp \
+       classes-properties.exp \
+       classes-signals.exp \
        structs.exp \
-       property-sample.exp \
+       interfaces.exp \
+       enums.exp \
+       delegates.exp \
+       exceptions.exp \
        \
-       test-001.exp \
-       test-002.exp \
-       test-003.exp \
-       test-004.exp \
-       test-005.exp \
-       test-006.exp \
-       test-007.exp \
-       test-008.exp \
-       test-009.exp \
-       test-010.exp \
-       test-011.exp \
-       test-012.exp \
-       test-013.exp \
-       test-014.exp \
        test-015.exp \
-       test-016.exp \
-       test-017.exp \
-       test-018.exp \
        test-019.exp \
-       test-020.exp \
        test-021.exp \
        test-022.exp \
        test-023.exp \
-       test-024.exp \
        test-025.exp \
        test-026.exp \
        test-027.exp \
-       test-028.exp \
        test-029.exp \
        test-030.exp \
        test-031.exp \
        test-032.exp \
-       test-033.exp \
        test-034.exp \
        test-035.exp \
        test-036.exp \
similarity index 100%
rename from tests/test-008.exp
rename to tests/classes-fields.exp
diff --git a/tests/classes-methods.exp b/tests/classes-methods.exp
new file mode 100644 (file)
index 0000000..8619eb6
--- /dev/null
@@ -0,0 +1,3 @@
+Inheritance Test: 1 2 3
+Static Inheritance Test: 1 2 3
+Virtual Method Test: 1 2 3
diff --git a/tests/classes-methods.vala b/tests/classes-methods.vala
new file mode 100644 (file)
index 0000000..b4c123f
--- /dev/null
@@ -0,0 +1,44 @@
+using GLib;
+
+class Maman.Bar : Object {
+       public void do_action () {
+               stdout.printf (" 2");
+       }
+
+       public static void do_static_action () {
+               stdout.printf (" 2");
+       }
+
+       public virtual void do_virtual_action () {
+               stdout.printf (" BAD");
+       }
+}
+
+class Maman.SubBar : Bar {
+       public override void do_virtual_action () {
+               stdout.printf (" 2");
+       }
+
+       static int main (string[] args) {
+               stdout.printf ("Inheritance Test: 1");
+
+               var bar = new SubBar ();
+               bar.do_action ();
+               
+               stdout.printf (" 3\n");
+
+               stdout.printf ("Static Inheritance Test: 1");
+
+               do_static_action ();
+
+               stdout.printf (" 3\n");
+
+               stdout.printf ("Virtual Method Test: 1");
+
+               bar.do_virtual_action ();
+       
+               stdout.printf (" 3\n");
+
+               return 0;
+       }
+}
similarity index 82%
rename from tests/property-sample.exp
rename to tests/classes-properties.exp
index 5478c66..0f43340 100644 (file)
@@ -3,3 +3,4 @@ automatic: TheNewAutomatic
 name: TheNewName
 read_only: InitialReadOnly
 automatic: TheNewAutomatic
+Property Test: 1 2 3 4 5 6
similarity index 54%
rename from tests/property-sample.vala
rename to tests/classes-properties.vala
index 5579995..4dff4ff 100644 (file)
@@ -1,6 +1,3 @@
-/* Properties Sample Code
- * Keep in sync with <http://live.gnome.org/Vala/PropertiesSample>
- */
 using GLib;
 
 public class Sample : Object {
@@ -54,11 +51,55 @@ public class Sample : Object {
                stdout.printf("automatic: %s\n", automatic);
         }
 
-        static int main (string[] args) {
-                var test = new Sample("InitialName");
+       static int main (string[] args) {
+               var test = new Sample("InitialName");
 
-                test.run();
+               test.run();
 
-                return 0;
-        }
+               Maman.Bar.run ();
+
+               return 0;
+       }
+}
+
+
+class Maman.Foo : Object {
+       private int _public_base_property = 2;
+       public int public_base_property {
+               get {
+                       return _public_base_property;
+               }
+               set {
+                       _public_base_property = value;
+               }
+       }
 }
+
+class Maman.Bar : Foo {
+       private int _public_property = 3;
+       public int public_property {
+               get {
+                       return _public_property;
+               }
+               set {
+                       _public_property = value;
+               }
+       }
+       
+       void do_action () {
+               stdout.printf (" %d %d", public_base_property, public_property);
+               public_base_property = 4;
+               public_property = 5;
+               stdout.printf (" %d %d", public_base_property, public_property);
+       }
+
+       public static void run () {
+               stdout.printf ("Property Test: 1");
+               
+               var bar = new Bar ();
+               bar.do_action ();
+               
+               stdout.printf (" 6\n");
+       }
+}
+
similarity index 53%
rename from tests/test-018.exp
rename to tests/classes-signals.exp
index 37c2032..c42d7ec 100644 (file)
@@ -1 +1,2 @@
 Signal Test: 1 2 3 4 5 6 7 8 9 10
+User Signal Test: 1 2 3 4 5 6
similarity index 61%
rename from tests/test-018.vala
rename to tests/classes-signals.vala
index 1bd38dc..555339f 100644 (file)
@@ -55,6 +55,40 @@ class Maman.Bar : Object {
        
                stdout.printf (" 10\n");
 
+               stdout.printf ("User Signal Test: 1");
+
+               var user_bar = new UserBar ();
+               user_bar.run ();
+
+               stdout.printf (" 6\n");
+
                return 0;
        }
 }
+
+class Maman.UserFoo : Object {
+       public signal void activated (int i1, int i2);
+
+       public void do_action () {
+               activated (6, -2);
+       }
+}
+
+class Maman.UserBar : Object {
+       public void run () {
+               stdout.printf (" 2");
+               
+               var foo = new UserFoo ();
+               
+               foo.activated += (foo, i1, i2) => {
+                       stdout.printf (" %d", i1 + i2);
+               };
+
+               stdout.printf (" 3");
+               
+               foo.do_action ();
+
+               stdout.printf (" 5");
+       }
+}
+
similarity index 100%
rename from tests/test-014.exp
rename to tests/delegates.exp
similarity index 100%
rename from tests/test-014.vala
rename to tests/delegates.vala
similarity index 100%
rename from tests/test-028.exp
rename to tests/enums.exp
similarity index 100%
rename from tests/test-028.vala
rename to tests/enums.vala
similarity index 100%
rename from tests/test-033.exp
rename to tests/exceptions.exp
similarity index 100%
rename from tests/test-033.vala
rename to tests/exceptions.vala
similarity index 100%
rename from tests/test-017.exp
rename to tests/interfaces.exp
similarity index 100%
rename from tests/test-017.vala
rename to tests/interfaces.vala
similarity index 61%
rename from tests/test-002.exp
rename to tests/namespaces.exp
index 9cd509a..5fd7a44 100644 (file)
@@ -1 +1,2 @@
+Namespace Test
 Class in Namespace Test
diff --git a/tests/namespaces.vala b/tests/namespaces.vala
new file mode 100644 (file)
index 0000000..3dcbdae
--- /dev/null
@@ -0,0 +1,18 @@
+using GLib;
+
+namespace Maman {
+       static int main (string[] args) {
+               stdout.printf ("Namespace Test\n");
+
+               Bar.run ();
+
+               return 0;
+       }
+
+       class Bar : Object {
+               public static void run () {
+                       stdout.printf ("Class in Namespace Test\n");
+               }
+       }
+}
+
similarity index 100%
rename from tests/test-013.exp
rename to tests/statements-jump.exp
similarity index 57%
rename from tests/test-020.exp
rename to tests/statements-selection.exp
index 040ff1d..0cd5103 100644 (file)
@@ -1 +1,2 @@
+For Test: 1 2 3 4 5 6 7
 Switch statement: 1 2 3 4 5 6 7
similarity index 83%
rename from tests/test-020.vala
rename to tests/statements-selection.vala
index d69c365..59a0ba5 100644 (file)
@@ -1,5 +1,27 @@
 using GLib;
 
+class Maman.Bar : Object {
+       static int main (string[] args) {
+               stdout.printf ("For Test: 1");
+
+               int i;
+               for (i = 2; i < 7; i++) {
+                       stdout.printf (" %d", i);
+               }
+               
+               stdout.printf (" 7\n");
+
+               stdout.printf ("Switch statement: 1");
+
+               var foo = new Foo ();
+               foo.run ();
+
+               stdout.printf (" 7\n");
+
+               return 0;
+       }
+}
+
 class Maman.Foo : Object {
        public void run () {
                stdout.printf (" 2");
@@ -43,17 +65,7 @@ class Maman.Foo : Object {
        public int inc () {
                return counter++;
        }
-
-       static int main (string[] args) {
-               stdout.printf ("Switch statement: 1");
-               
-               var foo = new Foo ();
-               foo.run ();
-       
-               stdout.printf (" 7\n");
-
-               return 0;
-       }
        
        private int counter = 0;
 }
+
diff --git a/tests/test-001.exp b/tests/test-001.exp
deleted file mode 100644 (file)
index 5d4f34f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Namespace Test
diff --git a/tests/test-001.vala b/tests/test-001.vala
deleted file mode 100644 (file)
index c5e73a0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-using GLib;
-
-namespace Maman {
-       static int main (string[] args) {
-               stdout.printf ("Namespace Test\n");
-               return 0;
-       }
-}
diff --git a/tests/test-002.vala b/tests/test-002.vala
deleted file mode 100644 (file)
index bb93511..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-using GLib;
-
-namespace Maman {
-       class Bar : Object {
-               static int main (string[] args) {
-                       stdout.printf ("Class in Namespace Test\n");
-                       return 0;
-               }
-       }
-}
-
diff --git a/tests/test-003.exp b/tests/test-003.exp
deleted file mode 100644 (file)
index 8fefc2a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subtype Test
diff --git a/tests/test-003.vala b/tests/test-003.vala
deleted file mode 100644 (file)
index 3003273..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-using GLib;
-
-class Maman.Bar : Object {
-}
-
-class Maman.SubBar : Bar {
-       static int main (string[] args) {
-               stdout.printf ("Subtype Test\n");
-               return 0;
-       }
-}
diff --git a/tests/test-004.exp b/tests/test-004.exp
deleted file mode 100644 (file)
index af5eb0c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Inheritance Test: 1 2 3
diff --git a/tests/test-004.vala b/tests/test-004.vala
deleted file mode 100644 (file)
index 0545ca2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-using GLib;
-
-class Maman.Bar : Object {
-       public void do_action () {
-               stdout.printf (" 2");
-       }
-}
-
-class Maman.SubBar : Bar {
-       static int main (string[] args) {
-               stdout.printf ("Inheritance Test: 1");
-
-               var bar = new SubBar ();
-               bar.do_action ();
-               
-               stdout.printf (" 3\n");
-       
-               return 0;
-       }
-}
diff --git a/tests/test-005.exp b/tests/test-005.exp
deleted file mode 100644 (file)
index c4fe5be..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Static Inheritance Test: 1 2 3
diff --git a/tests/test-005.vala b/tests/test-005.vala
deleted file mode 100644 (file)
index 7b6a178..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-using GLib;
-
-class Maman.Bar : Object {
-       public static void do_action () {
-               stdout.printf (" 2");
-       }
-}
-
-class Maman.SubBar : Bar {
-       static int main (string[] args) {
-               stdout.printf ("Static Inheritance Test: 1");
-
-               do_action ();
-               
-               stdout.printf (" 3\n");
-       
-               return 0;
-       }
-}
diff --git a/tests/test-006.exp b/tests/test-006.exp
deleted file mode 100644 (file)
index def00ac..0000000
+++ /dev/null
@@ -1 +0,0 @@
-For Test: 1 2 3 4 5 6 7
diff --git a/tests/test-006.vala b/tests/test-006.vala
deleted file mode 100644 (file)
index af210c9..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-using GLib;
-
-class Maman.Bar : Object {
-       static int main (string[] args) {
-               stdout.printf ("For Test: 1");
-
-               int i;
-               for (i = 2; i < 7; i++) {
-                       stdout.printf (" %d", i);
-               }
-               
-               stdout.printf (" 7\n");
-
-               return 0;
-       }
-}
diff --git a/tests/test-007.exp b/tests/test-007.exp
deleted file mode 100644 (file)
index 1411281..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Virtual Method Test: 1 2 3
diff --git a/tests/test-007.vala b/tests/test-007.vala
deleted file mode 100644 (file)
index 3322abc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-using GLib;
-
-class Maman.Bar : Object {
-       public virtual void do_action () {
-               stdout.printf (" BAD");
-       }
-}
-
-class Maman.SubBar : Bar {
-       public override void do_action () {
-               stdout.printf (" 2");
-       }
-
-       static int main (string[] args) {
-               stdout.printf ("Virtual Method Test: 1");
-
-               Bar bar = new SubBar ();
-               bar.do_action ();
-       
-               stdout.printf (" 3\n");
-
-               return 0;
-       }
-}
diff --git a/tests/test-009.exp b/tests/test-009.exp
deleted file mode 100644 (file)
index ebcd72d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Property Test: 1 2 3 4 5 6
diff --git a/tests/test-009.vala b/tests/test-009.vala
deleted file mode 100644 (file)
index 74c515c..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-using GLib;
-
-class Maman.Foo : Object {
-       private int _public_base_property = 2;
-       public int public_base_property {
-               get {
-                       return _public_base_property;
-               }
-               set {
-                       _public_base_property = value;
-               }
-       }
-}
-
-class Maman.Bar : Foo {
-       private int _public_property = 3;
-       public int public_property {
-               get {
-                       return _public_property;
-               }
-               set {
-                       _public_property = value;
-               }
-       }
-       
-       void do_action () {
-               stdout.printf (" %d %d", public_base_property, public_property);
-               public_base_property = 4;
-               public_property = 5;
-               stdout.printf (" %d %d", public_base_property, public_property);
-       }
-
-       static int main (string[] args) {
-               stdout.printf ("Property Test: 1");
-               
-               var bar = new Bar ();
-               bar.do_action ();
-               
-               stdout.printf (" 6\n");
-               
-               return 0;
-       }
-}
diff --git a/tests/test-012.exp b/tests/test-012.exp
deleted file mode 100644 (file)
index d5979ea..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Block Test: 1 2 3
diff --git a/tests/test-012.vala b/tests/test-012.vala
deleted file mode 100644 (file)
index 99e76f2..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-using GLib;
-
-class Maman.Bar : Object {
-       static int main (string[] args) {
-               stdout.printf ("Block Test: 1");
-               
-               {
-                       stdout.printf (" 2");
-               }
-               
-               stdout.printf (" 3\n");
-               
-               return 0;
-       }
-}
diff --git a/tests/test-024.exp b/tests/test-024.exp
deleted file mode 100644 (file)
index e505c4b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-User Signal Test: 1 2 3 4 5 6
diff --git a/tests/test-024.vala b/tests/test-024.vala
deleted file mode 100644 (file)
index 288b242..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-using GLib;
-
-class Maman.Foo : Object {
-       public signal void activated (int i1, int i2);
-
-       public void do_action () {
-               activated (6, -2);
-       }
-}
-
-class Maman.Bar : Object {
-       public void run () {
-               stdout.printf (" 2");
-               
-               var foo = new Foo ();
-               
-               foo.activated += (foo, i1, i2) => {
-                       stdout.printf (" %d", i1 + i2);
-               };
-
-               stdout.printf (" 3");
-               
-               foo.do_action ();
-
-               stdout.printf (" 5");
-       }
-
-       static int main (string[] args) {
-               stdout.printf ("User Signal Test: 1");
-               
-               var bar = new Bar ();
-               bar.run ();
-       
-               stdout.printf (" 6\n");
-
-               return 0;
-       }
-}