[gnome-break-timer] Run tests with the C locale by default



commit f5d476ca2f7ec4024a099125e0e6703e084eada4
Author: Dylan McCall <dylanmccall ubuntu com>
Date:   Mon Sep 16 17:11:54 2013 -0700

    Run tests with the C locale by default

 tests/common/test_NaturalTime.vala |   28 ++++++++++++++--------------
 tests/tests.vala                   |    2 ++
 2 files changed, 16 insertions(+), 14 deletions(-)
---
diff --git a/tests/common/test_NaturalTime.vala b/tests/common/test_NaturalTime.vala
index b59b7f3..5e89d26 100644
--- a/tests/common/test_NaturalTime.vala
+++ b/tests/common/test_NaturalTime.vala
@@ -34,9 +34,9 @@ class test_get_label_for_seconds : Object, SimpleTestCase<test_NaturalTime> {
        public void run(test_NaturalTime context) {
                var label_60 = context.natural_time.get_label_for_seconds(60);
                var label_61 = context.natural_time.get_label_for_seconds(61);
-
-               assert(label_60 == _("%d minute".printf(1)));
-               assert(label_61 == _("%d seconds".printf(61)));
+               
+               assert(label_60 == "%d minute".printf(1));
+               assert(label_61 == "%d seconds".printf(61));
        }
 }
 
@@ -45,8 +45,8 @@ class test_get_simplest_label_for_seconds : Object, SimpleTestCase<test_NaturalT
                var label_60 = context.natural_time.get_simplest_label_for_seconds(60);
                var label_61 = context.natural_time.get_simplest_label_for_seconds(61);
                
-               assert(label_60 == _("%d minute".printf(1)));
-               assert(label_61 == _("%d minute".printf(1)));
+               assert(label_60 == "%d minute".printf(1));
+               assert(label_61 == "%d minute".printf(1));
        }
 }
 
@@ -58,11 +58,11 @@ class test_get_countdown_for_seconds : Object, SimpleTestCase<test_NaturalTime>
                var label_42 = context.natural_time.get_countdown_for_seconds(42);
                var label_8 = context.natural_time.get_countdown_for_seconds(8);
                
-               assert(label_90 == _("%d minutes".printf(2)));
-               assert(label_60 == _("%d minute".printf(1)));
-               assert(label_55 == _("%d minute".printf(1)));
-               assert(label_42 == _("%d seconds".printf(50)));
-               assert(label_8 == _("%d seconds".printf(8)));
+               assert(label_90 == "%d minutes".printf(2));
+               assert(label_60 == "%d minute".printf(1));
+               assert(label_55 == "%d minute".printf(1));
+               assert(label_42 == "%d seconds".printf(50));
+               assert(label_8 == "%d seconds".printf(8));
        }
 }
 
@@ -73,9 +73,9 @@ class test_get_countdown_for_seconds_with_start : Object, SimpleTestCase<test_Na
                var label_55 = context.natural_time.get_countdown_for_seconds_with_start(55, 55);
                var label_51 = context.natural_time.get_countdown_for_seconds_with_start(51, 55);
                
-               assert(label_90 == _("%d minute".printf(1)));
-               assert(label_60 == _("%d seconds".printf(55)));
-               assert(label_55 == _("%d seconds".printf(55)));
-               assert(label_51 == _("%d seconds".printf(55)));
+               assert(label_90 == "%d minute".printf(1));
+               assert(label_60 == "%d seconds".printf(55));
+               assert(label_55 == "%d seconds".printf(55));
+               assert(label_51 == "%d seconds".printf(55));
        }
 }
diff --git a/tests/tests.vala b/tests/tests.vala
index 414135b..6bf6689 100644
--- a/tests/tests.vala
+++ b/tests/tests.vala
@@ -126,6 +126,8 @@ class TestRunner : Object {
        }
 
        public virtual void global_setup() {
+               Environment.set_variable ("LANGUAGE", "C", true);
+               
                try {
                        var tmp_path = DirUtils.make_tmp("gnome-break-timer-test-XXXXXX");
                        tmp_dir = File.new_for_path(tmp_path);


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