mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-27 22:33:06 +00:00
Normalize module-path
Modules indipendant of the path, should only be evaluated once.
This commit is contained in:
@@ -97,4 +97,21 @@ public:
|
||||
TS_ASSERT_THROWS(script.GetModuleLoader().LoadModule(rq, "nonexistent.js"),
|
||||
const std::runtime_error&);
|
||||
}
|
||||
|
||||
void test_EvaluateOnce()
|
||||
{
|
||||
ScriptInterface script{"Test", "Test", g_ScriptContext};
|
||||
const ScriptRequest rq{script};
|
||||
|
||||
{
|
||||
TestLogger logger;
|
||||
script.GetModuleLoader().LoadModule(rq, "blabbermouth.js");
|
||||
TS_ASSERT_STR_CONTAINS(logger.GetOutput(), "blah blah blah");
|
||||
}
|
||||
{
|
||||
TestLogger logger;
|
||||
script.GetModuleLoader().LoadModule(rq, "include/../blabbermouth.js");
|
||||
TS_ASSERT_STR_NOT_CONTAINS(logger.GetOutput(), "blah blah blah");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user