mu-view: test locale to C for tests

This commit is contained in:
Dirk-Jan C. Binnema
2023-07-29 17:25:07 +03:00
parent 3ada6af63a
commit 3a38d6366a
2 changed files with 5 additions and 1 deletions

View File

@ -145,7 +145,7 @@ struct TempTz {
old_tz_ = set_tz(tz);
else
old_tz_ = {};
mu_debug("timezone '{}' {}available", tz, old_tz_ ? "": "not");
mu_debug("timezone '{}' {}available", tz, old_tz_ ? "": "not ");
}
~TempTz() {
if (old_tz_) {

View File

@ -211,6 +211,7 @@ Mu::mu_cmd_view(const Options& opts)
#include <fcntl.h> /* Definition of AT_* constants */
#include <sys/stat.h>
#include <fstream>
#include <locale.h>
#include "utils/mu-test-utils.hh"
static constexpr std::string_view test_msg =
@ -249,6 +250,7 @@ test_view_plain()
g_test_skip("timezone not available");
return;
}
setlocale(LC_ALL, "C");
auto res = run_command({MU_PROGRAM, "view", msgpath});
assert_valid_command(res);
@ -274,6 +276,7 @@ test_view_html()
g_test_skip("timezone not available");
return;
}
setlocale(LC_ALL, "C");
auto res = run_command({MU_PROGRAM, "view", "--format=html", msgpath});
assert_valid_command(res);
@ -299,6 +302,7 @@ test_view_sexp()
g_test_skip("timezone not available");
return;
}
setlocale(LC_ALL, "C");
auto res = run_command({MU_PROGRAM, "view", "--format=sexp", msgpath});
assert_valid_command(res);