Skip to content

bats-assert testsuite fails in non English locales (+ no longer builds reproducibly) #90

@gioele

Description

@gioele

Hi, after #89 (thanks!) bats-assert's tests run flawlessly in English-based, but fails in locales based in other languages.

The issue is that the various assert_line() --regexp tests check for the presence of a specific string that Bash produces only when run in an English-based locale.

This issue also breaks the reproducibility of the Debian packages (reproducible packages are supposed to successfully build under different locales).

There are two possible approaches to fix this issue:

  1. Force the language inside the testsuite. This is what I'm doing in Debian. Regardless of the locale set in the environment, inside the testsuite everything will be run in English. In Debian I'm using LC_ALL=C.UTF-8, but C.UTF-8 may not be available in other systems (mac? win? musl?), so perhaps LC_ALL=C works better for you.

  2. Change the regexp tests to check something else than the text of the output.

Approach 2 is surely more robust, but I would suggest going for approach 1 because I don't see the a big advantage for bats-assert to extend its internal test coverage to non-English locales.

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