mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
26 lines
496 B
C++
26 lines
496 B
C++
#include <Core/Core.h>
|
|
|
|
using namespace Upp;
|
|
|
|
CONSOLE_APP_MAIN
|
|
{
|
|
StdLogSetup(LOG_COUT|LOG_FILE);
|
|
|
|
String cmd, out;
|
|
|
|
#ifdef PLATFORM_WIN32
|
|
cmd = "cmd /C \"echo 1 %FOOBAR% 2\"";
|
|
ASSERT(Sys(cmd) == "1 %FOOBAR% 2\r\n");
|
|
SetEnv("FOOBAR","BAZ");
|
|
ASSERT(Sys(cmd) == "1 BAZ 2\r\n");
|
|
#else
|
|
cmd = "bash -c \"echo 1 $FOOBAR 2\"";
|
|
ASSERT(Sys(cmd) == "1 2\n");
|
|
SetEnv("FOOBAR","BAZ");
|
|
ASSERT(Sys(cmd) == "1 BAZ 2\n");
|
|
#endif
|
|
|
|
ASSERT(GetEnv("FOOBAR") == "BAZ");
|
|
|
|
LOG("================= OK");
|
|
}
|