git.iko.soy/purescript-intl
on master help sign in
Use en_US locale - fixes test in travis.
commitca5d0b995003bb2b61ac12cbe7e52dcbf9da0dda authorCoot <mszamot@gmail.com> dateSat 17 Jun 2017, 19:35 (9 years ago) parent9827967
2 files changed+10−16
.travis.yml+2−9 test/Test/Main.purs+8−7
.travis.yml+2−9
@@ -4,14 +4,6 @@ sudo: required
44node_js: stable
55env:
66 - PATH=$HOME/purescript:$PATH
7− - global:
8− - LANG=en_GB.utf8
9− - LC_TIME=en_GB.utf8
10− - LC_MEASUREMENT=en_GB.utf8
11− - LC_NUMERIC=en_GB.utf8
12− - LC_MONETARY=en_GB.utf8
13−before_install:
14− - sudo apt-get update && sudo apt-get --reinstall install -qq language-pack-en
157install:
168 - TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p')
179 - wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
@@ -20,10 +12,11 @@ install:
2012 - npm install -g bower
2113 - npm install
2214script:
15+ - locale
2316 - bower install --production
2417 - npm run -s build
2518 - bower install
26− - npm -s test
19+ - LC_TIME="en_GB.UTF-8" npm -s test
2720after_success:
2821- >-
2922 test $TRAVIS_TAG &&
test/Test/Main.purs+8−7
@@ -3,6 +3,7 @@ module Test.Main where
33import Prelude
44
55import Control.Monad.Eff (Eff)
6+import Control.Monad.Eff.Unsafe (unsafePerformEff)
67import Control.Monad.Eff.Console (CONSOLE)
78import Data.DateTime (Date, DateTime(..), Month(..), canonicalDate)
89import Data.Enum (toEnum)
@@ -49,7 +50,7 @@ main = do
4950 let
5051
5152 locales :: LocalesOption
52− locales = inj (SProxy :: SProxy "locale") "en-GB"
53+ locales = inj (SProxy :: SProxy "locale") "en-US"
5354
5455 fmtHourMinute =
5556 createDateTimeFormatter locales opts
@@ -259,23 +260,23 @@ main = do
259260 Nothing -> unsafeCrashWith "jsDate not parsed"
260261 Just d -> do
261262 let fmtDate1 = formatJSDate fmtWeekdayYearMonthDayHourMinuteSecond d
262− fmtDate1Expected = "Tue, 2 January 2018, 12:00:00 pm"
263+ fmtDate1Expected = "Tue, January 2, 2018, 12:00:00 PM"
263264 assert' ("fmtWeekdayYearMonthDayHourMinuteSecond: got: '" <> fmtDate1 <> "' expected: '" <> fmtDate1Expected <> "'")
264265 $ fmtDate1 == fmtDate1Expected
265266 let fmtDate2 = formatJSDate fmtWeekdayYearMonthDay d
266− fmtDate2Expected = "Tuesday, 02 Jan 18"
267+ fmtDate2Expected = "Tuesday, Jan 02, 18"
267268 assert' ("fmtWeekdayYearMonthDayString: got '" <> fmtDate2 <> "' expected: '" <> fmtDate2Expected <> "'")
268269 $ fmtDate2 == fmtDate2Expected
269270 let fmtDate3 = formatJSDate fmtYearMonthDay d
270− fmtDate3Expected = "02 J 18"
271+ fmtDate3Expected = "J 02, 18"
271272 assert' ("fmtYearMonthDayString: got '" <> fmtDate3 <> "' expected: '" <> fmtDate3Expected <> "'")
272273 $ fmtDate3 == fmtDate3Expected
273274 let fmtDate4 = formatJSDate fmtYearMonth d
274− fmtDate4Expected = "01/2018"
275+ fmtDate4Expected = "1/2018"
275276 assert' ("fmtYearMonthString: got '" <> fmtDate4 <> "' expected: '" <> fmtDate4Expected <> "'")
276277 $ fmtDate4 == fmtDate4Expected
277278 let fmtDate5 = formatJSDate fmtMonthDay d
278− fmtDate5Expected = "02/01"
279+ fmtDate5Expected = "01/02"
279280 assert' ("fmtMonthDayString: got '" <> fmtDate5 <> "' expected: '" <> fmtDate5Expected <> "'")
280281 $ fmtDate5 == fmtDate5Expected
281282 let fmtDate6 = formatJSDate fmtHourMinuteSecond d
@@ -291,6 +292,6 @@ main = do
291292 assert' ("fmtEraYear: got '" <> fmtDate8 <> "' expected: '" <> fmtDate8Expected <> "'")
292293 $ fmtDate8 == fmtDate8Expected
293294 let fmtDate9 = formatJSDate fmtEra d
294− fmtDate9Expected = "2 1 2018 AD"
295+ fmtDate9Expected = "1 2, 2018 AD"
295296 assert' ("fmtEra: got '" <> fmtDate9 <> "' expected: '" <> fmtDate9Expected <> "'")
296297 $ fmtDate9 == fmtDate9Expected