diff options
| author | Leitwolf11 | 2026-11-06 02:45:48 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-11-06 02:45:48 +0300 |
| commit | 4dbeff2eea0fd2e0ad4c6da3d41f902dcdcf50ce (patch) | |
| tree | 357ed1d6650f9589c9d6f53d4ba9a7d27981e434 /apps/api-tests/ViGetTests.cs | |
| parent | 4a00a68309a3605dafedbc522569fc1b2c8aca1e (diff) | |
| download | progmaweb-feature/plugin-identity-from-command.tar.gz | |
Anchor the identity patterns at the end of the textfeature/plugin-identity-from-command
In .NET, $ also matches before a final line break, so a name or version
ending in one passed the check and was kept with it, giving a catalog entry
and a JAR path the public route never matches. The patterns end in \z.
Diffstat (limited to 'apps/api-tests/ViGetTests.cs')
| -rw-r--r-- | apps/api-tests/ViGetTests.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/api-tests/ViGetTests.cs b/apps/api-tests/ViGetTests.cs index 2037d30..0d39da5 100644 --- a/apps/api-tests/ViGetTests.cs +++ b/apps/api-tests/ViGetTests.cs @@ -70,6 +70,12 @@ public sealed class ViGetTests : IDisposable TazelPluginDescriptor.TryRead(Jar(), "Progmasoft", "c-make", "0.1.0", out _)); Assert.Equal("The publisher must be one identifier.", TazelPluginDescriptor.TryRead(Jar(), "Progma soft", "CMake", "0.1.0", out _)); + // A line break after the name or the version is not part of either. + Assert.Equal("The name of the plugin must be one identifier.", + TazelPluginDescriptor.TryRead(Jar(), "Progmasoft", "CMake\n", "0.1.0", out _)); + Assert.Equal("The version must be exact, of three to five numbers.", + TazelPluginDescriptor.TryRead(Jar(), "Progmasoft", "CMake", "0.1.0\n", out _)); + Assert.False(TazelPluginDescriptor.IsVersion("0.1.0\n")); Assert.Equal("The homepage of the descriptor is not an https address.", Read(Jar(homepage: "http\\://example.com"), out _)); Assert.Equal("The file is not a JAR.", Read("not a zip"u8.ToArray(), out _)); |