Add prefix to test filenames

This commit is contained in:
Yoshi Askharoun
2024-12-29 18:33:14 -06:00
parent 9d56376181
commit ca3686b383
+5 -1
View File
@@ -1,5 +1,6 @@
using OwlCore.ComponentModel; using OwlCore.ComponentModel;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using PathIO = System.IO.Path;
namespace UIX.Test.Helpers; namespace UIX.Test.Helpers;
@@ -21,8 +22,11 @@ internal class TempFile : IDisposable, IAsyncInit
{ {
_init = async delegate _init = async delegate
{ {
var fileName = $"uixtest_{PathIO.GetRandomFileName()}";
fileName = PathIO.ChangeExtension(fileName.Replace(".", ""), fileExtension);
Path = PathIO.Combine(PathIO.GetTempPath(), fileName);
// Copy the test data to a temporary file because Iris can only load from a URI. // Copy the test data to a temporary file because Iris can only load from a URI.
Path = System.IO.Path.ChangeExtension(System.IO.Path.GetTempFileName(), fileExtension);
await File.WriteAllBytesAsync(Path, data); await File.WriteAllBytesAsync(Path, data);
}; };
} }