Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Assets/Tests/Editor/CliInstallationDetectorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public void SelectPreferredDetection_WhenShellCommandShadowsPackageOwnedCliUsesS
// Verifies that the settings UI reports the same CLI command the user's terminal runs.
CliInstallationDetection packageOwnedDetection = new(
"3.0.0-beta.3",
"/Users/masamichi/.local/bin/uloop");
"/Users/ExampleUser/.local/bin/uloop");
CliInstallationDetection shellDetection = new(
"2.1.0",
"/Users/masamichi/.npm-global/bin/uloop");
"/Users/ExampleUser/.npm-global/bin/uloop");

CliInstallationDetection result = CliInstallationDetector.SelectPreferredDetection(
packageOwnedDetection,
shellDetection);

Assert.That(result.Version, Is.EqualTo("2.1.0"));
Assert.That(result.ExecutablePath, Is.EqualTo("/Users/masamichi/.npm-global/bin/uloop"));
Assert.That(result.ExecutablePath, Is.EqualTo("/Users/ExampleUser/.npm-global/bin/uloop"));
}

[Test]
Expand All @@ -36,7 +36,7 @@ public void SelectPreferredDetection_WhenShellCommandMissingUsesPackageOwnedCli(
// Verifies that package-owned installs still count when the shell cannot resolve uloop.
CliInstallationDetection packageOwnedDetection = new(
"3.0.0-beta.3",
"/Users/masamichi/.local/bin/uloop");
"/Users/ExampleUser/.local/bin/uloop");
CliInstallationDetection shellDetection = new(
null,
null);
Expand All @@ -46,7 +46,7 @@ public void SelectPreferredDetection_WhenShellCommandMissingUsesPackageOwnedCli(
shellDetection);

Assert.That(result.Version, Is.EqualTo("3.0.0-beta.3"));
Assert.That(result.ExecutablePath, Is.EqualTo("/Users/masamichi/.local/bin/uloop"));
Assert.That(result.ExecutablePath, Is.EqualTo("/Users/ExampleUser/.local/bin/uloop"));
}

[Test]
Expand All @@ -55,17 +55,17 @@ public void SelectPreferredDetection_WhenShellCommandExistsButVersionFailsUsesSh
// Verifies that a broken PATH command is surfaced instead of hidden by the package-owned binary.
CliInstallationDetection packageOwnedDetection = new(
"3.0.0-beta.3",
"/Users/masamichi/.local/bin/uloop");
"/Users/ExampleUser/.local/bin/uloop");
CliInstallationDetection shellDetection = new(
null,
"/Users/masamichi/.npm-global/bin/uloop");
"/Users/ExampleUser/.npm-global/bin/uloop");

CliInstallationDetection result = CliInstallationDetector.SelectPreferredDetection(
packageOwnedDetection,
shellDetection);

Assert.That(result.Version, Is.Null);
Assert.That(result.ExecutablePath, Is.EqualTo("/Users/masamichi/.npm-global/bin/uloop"));
Assert.That(result.ExecutablePath, Is.EqualTo("/Users/ExampleUser/.npm-global/bin/uloop"));
}

[Test]
Expand All @@ -74,17 +74,17 @@ public void SelectPreferredDetection_WhenPackageOwnedCliMissingUsesShellPath()
// Verifies that legacy CLI installs still surface as update candidates.
CliInstallationDetection packageOwnedDetection = new(
null,
"/Users/masamichi/.local/bin/uloop");
"/Users/ExampleUser/.local/bin/uloop");
CliInstallationDetection shellDetection = new(
"2.1.0",
"/Users/masamichi/.npm-global/bin/uloop");
"/Users/ExampleUser/.npm-global/bin/uloop");

CliInstallationDetection result = CliInstallationDetector.SelectPreferredDetection(
packageOwnedDetection,
shellDetection);

Assert.That(result.Version, Is.EqualTo("2.1.0"));
Assert.That(result.ExecutablePath, Is.EqualTo("/Users/masamichi/.npm-global/bin/uloop"));
Assert.That(result.ExecutablePath, Is.EqualTo("/Users/ExampleUser/.npm-global/bin/uloop"));
}

[Test]
Expand All @@ -93,7 +93,7 @@ public void SelectPreferredDetection_WhenShellVersionExistsWithoutPathUsesShellV
// Verifies that installed state does not depend on command path availability.
CliInstallationDetection packageOwnedDetection = new(
"3.0.0-beta.3",
"/Users/masamichi/.local/bin/uloop");
"/Users/ExampleUser/.local/bin/uloop");
CliInstallationDetection shellDetection = new(
"2.1.0",
null);
Expand Down Expand Up @@ -125,7 +125,7 @@ public void ParseShellCliInstallationOutput_WhenPathAndVersionExist_ReturnsDetec
// Verifies that shell detection keeps terminal-visible path data as auxiliary UI context.
string output = "banner\n"
+ "__ULOOP_PATH_START__\n"
+ "/Users/masamichi/.npm-global/bin/uloop\n"
+ "/Users/ExampleUser/.npm-global/bin/uloop\n"
+ "__ULOOP_PATH_END__\n"
+ "__ULOOP_VERSION_START__\n"
+ "2.1.1\n"
Expand All @@ -138,7 +138,7 @@ public void ParseShellCliInstallationOutput_WhenPathAndVersionExist_ReturnsDetec
CliInstallationDetector.ParseShellCliInstallationOutput(output);

Assert.That(detection.Version, Is.EqualTo("2.1.1"));
Assert.That(detection.ExecutablePath, Is.EqualTo("/Users/masamichi/.npm-global/bin/uloop"));
Assert.That(detection.ExecutablePath, Is.EqualTo("/Users/ExampleUser/.npm-global/bin/uloop"));
}

[Test]
Expand Down Expand Up @@ -166,7 +166,7 @@ public void ParseShellCliInstallationOutput_WhenVersionCommandFails_ReturnsPathW
{
// Verifies that failed shell probes do not treat stdout usage text as a CLI version.
string output = "__ULOOP_PATH_START__\n"
+ "/Users/masamichi/.npm-global/bin/uloop\n"
+ "/Users/ExampleUser/.npm-global/bin/uloop\n"
+ "__ULOOP_PATH_END__\n"
+ "__ULOOP_VERSION_START__\n"
+ "usage: broken uloop\n"
Expand All @@ -179,7 +179,7 @@ public void ParseShellCliInstallationOutput_WhenVersionCommandFails_ReturnsPathW
CliInstallationDetector.ParseShellCliInstallationOutput(output);

Assert.That(detection.Version, Is.Null);
Assert.That(detection.ExecutablePath, Is.EqualTo("/Users/masamichi/.npm-global/bin/uloop"));
Assert.That(detection.ExecutablePath, Is.EqualTo("/Users/ExampleUser/.npm-global/bin/uloop"));
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void ConfigureWorkerDotnetRuntimeEnvironment_WhenCalled_ShouldDisableMult
public void CreateCompileRequestCommand_WhenPathIsWindowsAbsolutePath_ShouldEncodeAsciiPayload()
{
string requestFilePath =
@"C:\Users\S06870\Documents\unity\vision-client_02\vision-client\Temp\UnityCliLoopCompilation\DynamicCommand_1.worker";
@"C:\Users\ExampleUser\Documents\unity\SampleWorkspace\SampleUnityProject\Temp\UnityCliLoopCompilation\DynamicCommand_1.worker";

string command = SharedRoslynCompilerWorkerHost.CreateCompileRequestCommandForTests(requestFilePath);

Expand Down
Loading
Loading