Created utility function to extract extension from filename, fixed tests
diff --git a/programs/fileio.c b/programs/fileio.c
index e59fb80..c0d6494 100644
--- a/programs/fileio.c
+++ b/programs/fileio.c
@@ -1430,6 +1430,9 @@
     return result;
 }
 
+/* List used to compare file extensions (used with --exclude-compressed flag)
+* Different from the suffixList and should only apply to ZSTD compress operationResult
+*/
 static const char *compressedFileExtensions[] = {
     ZSTD_EXTENSION,
     TZSTD_EXTENSION,
diff --git a/programs/util.c b/programs/util.c
index 7212f7b..f6933bc 100644
--- a/programs/util.c
+++ b/programs/util.c
@@ -326,23 +326,32 @@
 
 #endif /* #ifdef _WIN32 */
 
-/* Check if the file is precompressed (.zst, .lz4, .gz, .xz).
-YES => Skip the file (return 0)
-NO => return 1
+/* Check if the file is Compressed by comparing it with compressFileExtension list.
+YES => Skip the file (return 1)
+NO => return 0
 */
 
 int UTIL_isCompressedFile(const char *inputName, const char *extensionList[])
 {
+  const char* ext = UTIL_getFileExtension(inputName);
    while(*extensionList!=NULL)
    {
-     const char* ext = strstr(inputName,*extensionList);
-     if(ext)
+     const char* isCompressedExtension = strstr(ext,*extensionList);
+     if(isCompressedExtension)
         return 1;
       ++extensionList;
    }
    return 0;
 }
 
+/*Utility function to get file extension from file */
+const char* UTIL_getFileExtension(const char* infilename)
+{
+   const char* extension = strrchr(infilename, '.');
+   if(!extension || extension==infilename) return "";
+   return extension;
+}
+
 /*
  * UTIL_createFileList - takes a list of files and directories (params: inputNames, inputNamesNb), scans directories,
  *                       and returns a new list of files (params: return value, allocatedBuffer, allocatedNamesNb).
diff --git a/programs/util.h b/programs/util.h
index deaea03..0d0642c 100644
--- a/programs/util.h
+++ b/programs/util.h
@@ -135,6 +135,8 @@
 int UTIL_isSameFile(const char* file1, const char* file2);
 int UTIL_compareStr(const void *p1, const void *p2);
 int UTIL_isCompressedFile(const char* infilename, const char *extensionList[]);
+const char* UTIL_getFileExtension(const char* infilename);
+
 U32 UTIL_isFIFO(const char* infilename);
 U32 UTIL_isLink(const char* infilename);
 #define UTIL_FILESIZE_UNKNOWN  ((U64)(-1))
diff --git a/tests/playTests.sh b/tests/playTests.sh
index d36a9d9..6161983 100755
--- a/tests/playTests.sh
+++ b/tests/playTests.sh
@@ -230,12 +230,11 @@
 file1timestamp=`date -r precompressedFilterTestDir/input.5.zst +%s`
 file2timestamp=`date -r precompressedFilterTestDir/input.7.zst +%s`
 if [[ $file2timestamp -ge $file1timestamp ]]; then
-  println "Test is successful. input.5.zst is not precompressed and therefore not compressed/modified again."
+  println "Test is successful. input.5.zst is precompressed and therefore not compressed/modified again."
 else
   println "Test is not successful"
 fi
 println "Test completed"
-sleep 5
 
 println "test : file removal"
 $ZSTD -f --rm tmp