From 115315a03cefbdc6ec0da7ab174113a5950434f3 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Sun, 6 Aug 2017 22:25:00 +0100 Subject: [PATCH] Test the locale month name width stuff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit modifies a specific file timestamp so we test both July (which is 5 characters in French) and December (which is 4 characters in Japanese). It’s also kind of a test for locales as well. --- Vagrantfile | 15 +++++++++++++-- xtests/dates_accessed | 2 +- xtests/dates_fr | 3 +++ xtests/dates_full_iso | 2 +- xtests/dates_iso | 2 +- xtests/dates_jp | 3 +++ xtests/dates_long_iso | 2 +- xtests/dates_modified | 2 +- xtests/run.sh | 6 ++++++ 9 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 xtests/dates_fr create mode 100644 xtests/dates_jp diff --git a/Vagrantfile b/Vagrantfile index 4c26c90..443a9c5 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -296,8 +296,8 @@ Vagrant.configure(2) do |config| EOF old = '200303030000.00' - med = '200606152314.29' - new = '200907221038.53' + med = '200606152314.29' # the june gets used for fr_FR locale tests + new = '200912221038.53' # and the december for ja_JP local tests # Awkward date and time testcases. config.vm.provision :shell, privileged: false, inline: <<-EOF @@ -429,6 +429,17 @@ Vagrant.configure(2) do |config| EOF + # Set up some locales + config.vm.provision :shell, privileged: false, inline: <<-EOF + set -xe + + # uncomment these from the config file + sudo sed -i '/fr_FR.UTF-8/s/^# //g' /etc/locale.gen + sudo sed -i '/ja_JP.UTF-8/s/^# //g' /etc/locale.gen + sudo locale-gen + EOF + + # Install kcov for test coverage # This doesn’t run coverage over the xtests so it’s less useful for now if ENV.key?('INSTALL_KCOV') diff --git a/xtests/dates_accessed b/xtests/dates_accessed index 3d80658..a6cf3ed 100644 --- a/xtests/dates_accessed +++ b/xtests/dates_accessed @@ -1,4 +1,4 @@ Permissions Size User Date Accessed Name .rw-rw-r-- 0 cassowary  3 Mar 2003 plum .rw-rw-r-- 0 cassowary 15 Jun 2006 pear -.rw-rw-r-- 0 cassowary 22 Jul 2009 peach +.rw-rw-r-- 0 cassowary 22 Dec 2009 peach diff --git a/xtests/dates_fr b/xtests/dates_fr new file mode 100644 index 0000000..4bec43d --- /dev/null +++ b/xtests/dates_fr @@ -0,0 +1,3 @@ +.rw-rw-r-- 0 cassowary 15 juin 2006 peach +.rw-rw-r-- 0 cassowary  3 mars 2003 pear +.rw-rw-r-- 0 cassowary 22 déc. 2009 plum diff --git a/xtests/dates_full_iso b/xtests/dates_full_iso index 397d771..3120218 100644 --- a/xtests/dates_full_iso +++ b/xtests/dates_full_iso @@ -1,3 +1,3 @@ .rw-rw-r-- 0 cassowary 2006-06-15 23:14:29.000000000 +0000 peach .rw-rw-r-- 0 cassowary 2003-03-03 00:00:00.000000000 +0000 pear -.rw-rw-r-- 0 cassowary 2009-07-22 10:38:53.000000000 +0000 plum +.rw-rw-r-- 0 cassowary 2009-12-22 10:38:53.000000000 +0000 plum diff --git a/xtests/dates_iso b/xtests/dates_iso index 9a54389..6ea2ef2 100644 --- a/xtests/dates_iso +++ b/xtests/dates_iso @@ -1,3 +1,3 @@ .rw-rw-r-- 0 cassowary 2006-06-15 peach .rw-rw-r-- 0 cassowary 2003-03-03 pear -.rw-rw-r-- 0 cassowary 2009-07-22 plum +.rw-rw-r-- 0 cassowary 2009-12-22 plum diff --git a/xtests/dates_jp b/xtests/dates_jp new file mode 100644 index 0000000..417a432 --- /dev/null +++ b/xtests/dates_jp @@ -0,0 +1,3 @@ +.rw-rw-r-- 0 cassowary 15 6月 2006 peach +.rw-rw-r-- 0 cassowary  3 3月 2003 pear +.rw-rw-r-- 0 cassowary 22 12月 2009 plum diff --git a/xtests/dates_long_iso b/xtests/dates_long_iso index 2694a17..d69cb05 100644 --- a/xtests/dates_long_iso +++ b/xtests/dates_long_iso @@ -1,3 +1,3 @@ .rw-rw-r-- 0 cassowary 2006-06-15 23:14 peach .rw-rw-r-- 0 cassowary 2003-03-03 00:00 pear -.rw-rw-r-- 0 cassowary 2009-07-22 10:38 plum +.rw-rw-r-- 0 cassowary 2009-12-22 10:38 plum diff --git a/xtests/dates_modified b/xtests/dates_modified index 166b68f..bde011f 100644 --- a/xtests/dates_modified +++ b/xtests/dates_modified @@ -1,4 +1,4 @@ Permissions Size User Date Modified Name .rw-rw-r-- 0 cassowary  3 Mar 2003 pear .rw-rw-r-- 0 cassowary 15 Jun 2006 peach -.rw-rw-r-- 0 cassowary 22 Jul 2009 plum +.rw-rw-r-- 0 cassowary 22 Dec 2009 plum diff --git a/xtests/run.sh b/xtests/run.sh index 9425585..5946e6f 100755 --- a/xtests/run.sh +++ b/xtests/run.sh @@ -116,6 +116,12 @@ $exa $testcases/dates -l --time-style=long-iso 2>&1 | diff -q - $results/d $exa $testcases/dates -l --time-style=full-iso 2>&1 | diff -q - $results/dates_full_iso || exit 1 $exa $testcases/dates -l --time-style=iso 2>&1 | diff -q - $results/dates_iso || exit 1 +# Locales +# These two are used in particular because they have 5-long and 4-long +# month names respectively +env LANG=fr_FR.UTF-8 $exa $testcases/dates -l | diff -q - $results/dates_fr || exit 1 +env LANG=ja_JP.UTF-8 $exa $testcases/dates -l | diff -q - $results/dates_jp || exit 1 + # Paths and directories # These directories are created in the VM user’s home directory (the default