1
0

refactor: move env outside from rust namespace

This commit is contained in:
2025-10-07 18:03:40 +08:00
parent 64045b1d48
commit eda801d3c7
6 changed files with 21 additions and 21 deletions

View File

@ -20,7 +20,7 @@ PRIVATE
yycc/patch/fopen.cpp
yycc/patch/stream.cpp
yycc/patch/format.cpp
yycc/rust/env.cpp
yycc/env.cpp
yycc/string/reinterpret.cpp
yycc/string/op.cpp
yycc/num/parse.cpp

View File

@ -1,17 +1,17 @@
#include <gtest/gtest.h>
#include <yycc.hpp>
#include <yycc/rust/env.hpp>
#include <yycc/env.hpp>
#include <yycc/macro/os_detector.hpp>
#include <filesystem>
#define ENV ::yycc::rust::env
#define ENV ::yycc::env
namespace yycctest::rust::env {
namespace yycctest::env {
constexpr char8_t VAR_NAME[] = u8"HOMER";
constexpr char8_t VAR_VALUE[] = u8"doh";
TEST(RustEnv, EnvVar) {
TEST(Env, EnvVar) {
// Write a new variable should okey
{
auto rv = ENV::set_var(VAR_NAME, VAR_VALUE);
@ -44,7 +44,7 @@ namespace yycctest::rust::env {
}
}
TEST(RustEnv, CurrentExe) {
TEST(Env, CurrentExe) {
auto rv = ENV::current_exe();
ASSERT_TRUE(rv.has_value());
@ -59,4 +59,4 @@ namespace yycctest::rust::env {
#endif
}
} // namespace yycctest::rust::env
} // namespace yycctest::env