summaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/common
diff options
context:
space:
mode:
authornicktitov <[email protected]>2025-11-26 09:20:26 +0300
committernicktitov <[email protected]>2025-11-26 09:33:39 +0300
commitfd10a2603c35aefac37abd55c2062844e8ea3628 (patch)
tree8efcbbd2b9ff443175ea558dc6b131e1d436245f /library/cpp/testing/common
parent0cb0f05e90c181852cadf7f3a676defeee9e775c (diff)
Update env contract to deal with null
В продолжение <https://nda.ya.ru/t/Zv2eRt4A7Ncwc7> Поддерживаем контракт в env.cpp (используется в BinaryPath), т.к. он тоже строит из `env.json.txt` окружение и при обнаружении Null падает commit_hash:6d01c031662f29c665a54fe4f4036a3bf7dea99a
Diffstat (limited to 'library/cpp/testing/common')
-rw-r--r--library/cpp/testing/common/env.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/library/cpp/testing/common/env.cpp b/library/cpp/testing/common/env.cpp
index 41bf2b20aba..a536aab2a7b 100644
--- a/library/cpp/testing/common/env.cpp
+++ b/library/cpp/testing/common/env.cpp
@@ -224,7 +224,12 @@ namespace NPrivate {
while (file.ReadLine(ljson) > 0) {
NJson::ReadJsonTree(ljson, &envVar);
for (const auto& entry : envVar.GetMap()) {
- SetEnv(entry.first, entry.second.GetStringSafe(""));
+ auto value = entry.second;
+ if (value.GetType() == NJson::JSON_NULL) {
+ UnsetEnv(entry.first);
+ } else {
+ SetEnv(entry.first, value.GetStringSafe(""));
+ }
}
}
}