From ad69ee977ede3fb8733c4885f8ed2fdcaea3efd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 15 Oct 2026 00:07:27 -0300 Subject: [PATCH] Fix project encoding test scanning downloaded SDL3 SDKs Skip versioned SDL2 and SDL3 SDK directories before recursing, preventing bundled libraries and debug symbols from being treated as project text files. --- src/tests/unit_tests/textformat_tests.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/tests/unit_tests/textformat_tests.cpp b/src/tests/unit_tests/textformat_tests.cpp index e79c2d4a0..d856e9271 100644 --- a/src/tests/unit_tests/textformat_tests.cpp +++ b/src/tests/unit_tests/textformat_tests.cpp @@ -94,17 +94,16 @@ UTEST( TextFormat, autodetectProject ) { auto files = FileSystem::filesInfoGetInPath( folder, false, true, true, true ); for ( const auto& file : files ) { if ( file.isDirectory() ) { - checkFolder( file.getFilepath() ); + // Downloaded SDL SDKs contain platform binaries outside this source scan. + if ( !LuaPattern::hasMatches( file.getFileName(), "^SDL[23]%-%d+%.%d+%.%d+$" ) ) + checkFolder( file.getFilepath() ); continue; } auto extension = file.getExtension(); - bool fromSDLFolder = false; if ( "a" == extension || "zip" == extension || "dll" == extension || "dat" == extension || "cur" == extension || "icns" == extension || - "wav" == extension || Image::isImageExtension( file.getFilepath() ) || - ( fromSDLFolder = - LuaPattern::hasMatches( file.getFilepath(), "SDL2%-%d+%.%d+%.%d+" ) ) ) { - if ( !fromSDLFolder && "dat" != extension ) { + "wav" == extension || Image::isImageExtension( file.getFilepath() ) ) { + if ( "dat" != extension ) { EXPECT_TRUE_MSG( TextDocument::fileMightBeBinary( file.getFilepath() ), String::format( "File %s should be detected as binary file", file.getFilepath() )