Build Charac server and client with OIDC, SSH sessions, and packages
Verify / verify (ubuntu-latest, linux-bionic-arm64) (push) Canceled after 0s
Verify / verify (ubuntu-latest, linux-x64) (push) Canceled after 0s
Verify / verify (windows-latest, win-x64) (push) Canceled after 0s
Verify / postgres (push) Canceled after 0s

This commit is contained in:
Nitload
2026-10-05 14:02:50 +08:00
parent 4bc3552167
commit 0ea679932e
185 changed files with 10653 additions and 772 deletions
@@ -0,0 +1,35 @@
using Charac.Server.Hosting;
namespace Charac.Server.Tests;
public sealed class ServerCommandLineTests
{
[Fact]
public void ConfigOptionCanPrecedeOrFollowCommand()
{
var first = ServerCommandLine.Parse(["--config", "custom.config", "database", "migrate"]);
var last = ServerCommandLine.Parse(["database", "migrate", "--config=custom.config"]);
Assert.Equal("custom.config", first.ConfigPath);
Assert.Equal(["database", "migrate"], first.Command);
Assert.Equal(first.ConfigPath, last.ConfigPath);
Assert.Equal(first.Command, last.Command);
}
[Theory]
[InlineData("--config")]
[InlineData("--config=")]
[InlineData("--config", "--help")]
[InlineData("--config=a.config", "--config=b.config")]
public void MissingOrRepeatedConfigPathIsRejected(params string[] args)
{
Assert.Throws<ArgumentException>(() => ServerCommandLine.Parse(args));
}
[Fact]
public void ExplicitConfigDoesNotFallBackWhenMissing()
{
var missing = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".config");
Assert.Throws<FileNotFoundException>(() => WorkspaceAccessConfiguration.PathToLoad(missing));
}
}