Fix relocated desktop tool paths and package release 0.2.2

This commit is contained in:
tongtong committed 2026-11-13 12:49:10 +08:00
1 parent efaf16de18
commit e366eb5bec
14 files changed
+250 -33

No files matched your search

@@ -0,0 +1,20 @@
using Ads.Desktop;
using Xunit;
namespace Ads.Desktop.Tests;
public class ToolRelocationTests {
[Fact] public void RelocatedManagedPathUsesCurrentBundle() {
var name="relocate-"+Guid.NewGuid().ToString("N");
var executable=name+(OperatingSystem.IsWindows()?".exe":"");
var bundled=Path.Combine(AppContext.BaseDirectory,executable);
try {
File.WriteAllText(bundled,"fixture");
var old="C:/Users/TT/AppData/Local/Programs/TTSTD/ADS-Avalonia/"+executable;
Assert.Equal(bundled,DesktopPaths.ResolveTool(old,name));
}finally{File.Delete(bundled);}
}
[Fact] public void ValidCustomToolIsPreserved() {
var file=Path.GetTempFileName();
try{Assert.Equal(Path.GetFullPath(file),DesktopPaths.ResolveTool(file,"adb"));}
finally{File.Delete(file);}
}
}