Fixes bug in scriptset where lookup would no longer point to valid script after removing one preceding it.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -84,4 +84,17 @@ TEST_CASE("Add two scripts to script set, then remove them") {
|
||||
REQUIRE(it.At(0)->GetName() == "foobar2");
|
||||
}
|
||||
|
||||
TEST_CASE("Add two scripts to script set, remove the first, get second by name") {
|
||||
auto set = ScriptSet();
|
||||
auto s = new TestScript("foobar");
|
||||
auto s2 = new TestScript("foobar2");
|
||||
set.Add(s);
|
||||
set.Add(s2);
|
||||
REQUIRE(set.Count() == 2);
|
||||
set.Remove("foobar"_cnc.GetHash());
|
||||
REQUIRE(set.Count() == 1);
|
||||
auto retrieved = set.Get("foobar2"_cnc);
|
||||
REQUIRE(retrieved == s2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user