[gitg/wip/commit: 10/28] Check if all files were seen



commit 0f6e886bc47b6f95bed28d97a7343a328219ee89
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sat Jun 29 20:00:12 2013 +0200

    Check if all files were seen

 libgitg/tests/test-stage.vala |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libgitg/tests/test-stage.vala b/libgitg/tests/test-stage.vala
index a873e6f..9faa6e2 100644
--- a/libgitg/tests/test-stage.vala
+++ b/libgitg/tests/test-stage.vala
@@ -37,6 +37,10 @@ class Gitg.Test.Stage : Gitg.Test.Repository
 
        protected virtual signal void test_index_files()
        {
+               /* Test whether the different file statuses created by the set_up()
+                * are properly reported by the stage file status enumerator.
+                */
+
                var stage = d_repository.get_stage();
                var e = stage.file_status();
 
@@ -47,9 +51,12 @@ class Gitg.Test.Stage : Gitg.Test.Repository
 
                        assert(files.length == 3);
 
+                       var seen = new Gee.HashSet<string>();
+
                        foreach (var f in files)
                        {
                                assert(f.path == "a" || f.path == "b" || f.path == "c");
+                               seen.add(f.path);
 
                                switch (f.path)
                                {
@@ -66,6 +73,10 @@ class Gitg.Test.Stage : Gitg.Test.Repository
                                }
                        }
 
+                       assert("a" in seen);
+                       assert("b" in seen);
+                       assert("c" in seen);
+
                        loop.quit();
                });
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]