storaged-project / libbytesize

A tiny library providing a C "class" for working with arbitrary big sizes in bytes
GNU Lesser General Public License v2.1
20 stars 21 forks source link

Fix skipping tests when required locale is missing #107

Closed vojtechtrefny closed 2 years ago

vojtechtrefny commented 2 years ago

We cannot use the decorator to skip the tests if the "default" locale is missing because the decorator evaluates before we set the locale from the cmdline argument.

Fixes: #105

vojtechtrefny commented 2 years ago

This is only a problem if the DEFAULT_LOCALE locale is missing, right? The commit message should reflect that. The current wording suggests the decorator should not be used anywhere.

I've tried to reword the commit message. The problem is that the decorator now checks only for en_US.utf8 which is default for DEFAULT_LOCALE and the change we do in main if user specifies different default locale on cmdline is not reflected because the decorator is already evaluated at that point.