@@ -221,6 +221,44 @@ TEST_CASE("Editor - Pillar Yard round trip and sprite assets")
221221 }
222222}
223223
224+ TEST_CASE (" Editor - Brick Wall round trip and sprite assets" )
225+ {
226+ namespace fs = std::filesystem;
227+
228+ LevelFile brickWall;
229+ REQUIRE (LoadLevelFile (MAPS_DIR " brick_wall.txt" , brickWall));
230+ CHECK (brickWall.width == 15 );
231+ CHECK (brickWall.height == 8 );
232+ CHECK (brickWall.tiles [4 * brickWall.width + 10 ][0 ] ==
233+ ObjectType::ICON_BRICK );
234+ CHECK (brickWall.tiles [4 * brickWall.width + 11 ][0 ] ==
235+ ObjectType::ICON_FLAG );
236+ CHECK (brickWall.tiles [4 * brickWall.width + 11 ][1 ] ==
237+ ObjectType::ICON_EMPTY );
238+
239+ const fs::path path =
240+ fs::current_path () / " baba-is-auto-brick-wall-round-trip.txt" ;
241+ std::error_code error;
242+ CHECK (SaveLevelFile (path, brickWall));
243+
244+ LevelFile loaded;
245+ REQUIRE (LoadLevelFile (path, loaded));
246+ CHECK (loaded.tiles == brickWall.tiles );
247+ CHECK (loaded.directions == brickWall.directions );
248+
249+ fs::remove (path, error);
250+
251+ const fs::path root = (fs::path (MAPS_DIR ) / " ../.." ).lexically_normal ();
252+
253+ for (const char * asset : {
254+ " Extensions/BabaGUI/sprites/text/BRICK.gif" ,
255+ " Extensions/BabaGUI/sprites/icon/BRICK.gif" ,
256+ })
257+ {
258+ CHECK (fs::is_regular_file (root / asset));
259+ }
260+ }
261+
224262TEST_CASE (" Editor - Layer tile direction updates" )
225263{
226264 LevelFile::LayerTile tiles{ ObjectType::ICON_EMPTY , ObjectType::ICON_EMPTY ,
0 commit comments