• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moment / moment / 4818
88%
master: 88%

Build:
Build:
LAST BUILD BRANCH: wip/weird-weeks
DEFAULT BRANCH: master
Ran 25 Apr 2020 08:38PM UTC
Jobs 4
Files 321
Run time 51s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
4818

push

travis-ci

ichernev
[bugfix] Properly fallback to base locales in array getter

It looks like the existing implementation of this feature was pretty
well thought out and correct, the problem was that a compareArray
function was used which was comparing arrays in a rather bizzare
fashion that was not in line with what a "normal person" would expect.
So now the array comparator is correct, and the logic works properly.

The logic works as follows -- the next locale is picked and tried as-is.
If that fails, the code normally tries to chop the last bit (normally
the country designation) and try again. However, if the next array
element has the same or longer prefix as the one to be tried, the
iteration continues. So for example if the array has the sequence

    "AA-BB", "AA-CC", "XX-YY"

then first "AA-BB" is tried, then a naive solution would try "AA", but
this one instead checks to see that "AA-CC" is actually more concrete
than "AA", so it tries "AA-CC" next, and only after it fails (if it
fails) it tries "AA", because "XX-YY" does not have "AA" as prefix. So
in the end the following locales are tried in this order (assuming all
fail so the next one is tried):

    "AA-BB", "AA-CC", "AA", "XX-YY", "XX"

Fixes #4780

7387 of 14519 branches covered (50.88%)

45205 of 51145 relevant lines covered (88.39%)

9002.45 hits per line

Jobs
ID Job ID Ran Files Coverage
1 4818.1 (SAUCE_USERNAME=[secure] SAUCE_ACCESS_KEY=[secure]) 25 Apr 2020 08:38PM UTC 0
88.39
Travis Job 4818.1
2 4818.2 (SAUCE_USERNAME=[secure] SAUCE_ACCESS_KEY=[secure]) 25 Apr 2020 08:38PM UTC 0
88.39
Travis Job 4818.2
3 4818.3 (SAUCE_USERNAME=[secure] SAUCE_ACCESS_KEY=[secure]) 25 Apr 2020 08:38PM UTC 0
88.39
Travis Job 4818.3
4 4818.4 (SAUCE_USERNAME=[secure] SAUCE_ACCESS_KEY=[secure]) 25 Apr 2020 08:38PM UTC 0
88.39
Travis Job 4818.4
Source Files on build 4818
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #4818
  • c78921c5 on github
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc