mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-22 18:29:03 +01:00
Merge branch 'getenv-invalid-names' into 'main'
genvironment: consider macOS behavior when testing g_getenv See merge request GNOME/glib!4899
This commit is contained in:
@@ -127,10 +127,14 @@ test_getenv (void)
|
||||
g_assert_true (g_setenv ("foo", "bar=baz", TRUE));
|
||||
|
||||
/* Different OSs return different values; some return NULL because the key
|
||||
* is invalid, but some are happy to return what we set above. */
|
||||
* is invalid, but some are happy to return what we set above. macOS clips
|
||||
* the key when it contains `=` */
|
||||
data = g_getenv ("foo=bar");
|
||||
if (data != NULL)
|
||||
g_assert_cmpstr (data, ==, "baz");
|
||||
{
|
||||
g_assert_true (g_strcmp0 (data, "bar=baz") == 0 ||
|
||||
g_strcmp0 (data, "baz") == 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
data = g_getenv ("foo");
|
||||
|
||||
@@ -33,10 +33,7 @@ glib_tests = {
|
||||
'can_fail' : host_system == 'darwin' or linux_libc == 'musl',
|
||||
},
|
||||
'dir' : {},
|
||||
'environment' : {
|
||||
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
|
||||
'can_fail' : host_system == 'darwin',
|
||||
},
|
||||
'environment' : {},
|
||||
'error' : {},
|
||||
'fileutils' : {},
|
||||
'gdatetime' : {
|
||||
|
||||
Reference in New Issue
Block a user