Hi Andrés,
There's no bug here. File.extractCompleteSuffix() returns the whole file suffix (aka whole extension) of a file path specification, which can include several dot separators. For example:
console.writeln( File.extractCompleteSuffix( "/dir1/dir2.1test.fit" ) );
outputs ".1test.fit". A typical case where this method is useful is to extract compound file suffixes such as "file.tar.gz". This is very common on UNIX/Linux platforms.
In your example:
var path = "/dir1/dir2.1/test.fit";
the problem is that a slash character is illegal in a file suffix. Hence, the File.extractCompleteSuffix() function returns an empty string.
For your script, instead of File.extractCompleteSuffix() you should use File.extractSuffix(), which will extract just the last component of a compound file suffix:
console.writeln( File.extractSuffix( "/dir1/dir2.1/test.fit" ) );
outputs ".fit", as expected.