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.
This commit is contained in:
Martín Lucas Golini
2026-10-15 00:07:27 -03:00
parent 0b182de93e
commit ad69ee977e
+5 -6
View File
@@ -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() )