diff --git a/Content.IntegrationTests/Tests/EntityTest.cs b/Content.IntegrationTests/Tests/EntityTest.cs index 958621c562..1409b8029f 100644 --- a/Content.IntegrationTests/Tests/EntityTest.cs +++ b/Content.IntegrationTests/Tests/EntityTest.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using NUnit.Framework; -using Robust.Server.Interfaces.Maps; using Robust.Server.Interfaces.Timing; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; diff --git a/Content.IntegrationTests/Tests/PostMapInitTest.cs b/Content.IntegrationTests/Tests/PostMapInitTest.cs new file mode 100644 index 0000000000..e29926951e --- /dev/null +++ b/Content.IntegrationTests/Tests/PostMapInitTest.cs @@ -0,0 +1,60 @@ +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using NUnit.Framework; +using Robust.Shared.Interfaces.Resources; +using Robust.Shared.Utility; +using YamlDotNet.RepresentationModel; + +namespace Content.IntegrationTests.Tests +{ + [TestFixture] + public class PostMapInitTest : ContentIntegrationTest + { + public readonly string[] SkippedMaps = + { + "/Maps/Pathfinding/simple.yml" + }; + + [Test] + public async Task NoSavedPostMapInitTest() + { + var server = StartServerDummyTicker(); + + await server.WaitIdleAsync(); + + var resourceManager = server.ResolveDependency(); + var mapFolder = new ResourcePath("/Maps"); + var maps = resourceManager + .ContentFindFiles(mapFolder) + .Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith(".")) + .ToArray(); + + foreach (var map in maps) + { + var rootedPath = map.ToRootedPath(); + + if (SkippedMaps.Contains(rootedPath.ToString())) + { + continue; + } + + if (!resourceManager.TryContentFileRead(rootedPath, out var fileStream)) + { + Assert.Fail($"Map not found: {rootedPath}"); + } + + using var reader = new StreamReader(fileStream); + var yamlStream = new YamlStream(); + + yamlStream.Load(reader); + + var root = yamlStream.Documents[0].RootNode; + var meta = root["meta"]; + var postMapInit = meta["postmapinit"].AsBool(); + + Assert.False(postMapInit); + } + } + } +}