mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add core tests, fix found issues
This commit is contained in:
@@ -124,6 +124,10 @@ namespace SabreTools.Core.Tools
|
||||
/// <returns>Subfolder path for the given hash</returns>
|
||||
public static string GetDepotPath(string hash, int depth)
|
||||
{
|
||||
// If the hash is null or empty, then we return null
|
||||
if (string.IsNullOrEmpty(hash))
|
||||
return null;
|
||||
|
||||
// If the hash isn't the right size, then we return null
|
||||
if (hash.Length != Constants.SHA1Length)
|
||||
return null;
|
||||
@@ -153,8 +157,12 @@ namespace SabreTools.Core.Tools
|
||||
/// <returns>True if the extension is valid, false otherwise</returns>
|
||||
public static bool HasValidDatExtension(string path)
|
||||
{
|
||||
// If the path is null or empty, then we return false
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return false;
|
||||
|
||||
// Get the extension from the path, if possible
|
||||
string ext = Path.GetExtension(path).TrimStart('.');
|
||||
string ext = Path.GetExtension(path).TrimStart('.').ToLowerInvariant();
|
||||
|
||||
// Check against the list of known DAT extensions
|
||||
switch (ext)
|
||||
|
||||
Reference in New Issue
Block a user