Skip to content

Cross platform differences #1157

@swotlycto

Description

@swotlycto

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions