Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross platform differences #1157

Open
swotlycto opened this issue Dec 22, 2021 · 0 comments
Open

Cross platform differences #1157

swotlycto opened this issue Dec 22, 2021 · 0 comments

Comments

@swotlycto
Copy link

swotlycto commented Dec 22, 2021

Hi,

I'm noticing differences between humanized lists created on Windows and on Unix.

The following test passes on a Windows machine:

using FluentAssertions;
using Humanizer;
using Xunit;

namespace Swotly.Core.UnitTests
{
    public class HumanizerTests
    {
        [Fact]
        public void Lists_have_trailing_comma()
        {
            new[] { "one", "two", "three" }.Humanize("and").Should().Be("one, two, and three");
        }
    }
}

But it fails within a GitHub Action running a ubuntu image with:

Expected string to be "one, two, and three" with a length of 19, but "one, two and three" has a length of 18, differs near " an" (index 8).

Initially, I thought this might be a locale issue. But I still get the error, even after setting the locale as follows:

- name: Set locale to en-GB run: | sudo locale-gen en_GB.UTF-8 sudo update-locale LANG=en_GB.UTF-8

I appreciate this is more likely to be PEBCAK than an issue with Humanizer but wondered if anyone else has seen similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant