Esempio n. 1
0
        public void parse_npm_syntax_error(string p)
        {
            var r = SVersionBound.NpmTryParse(p);

            r.IsValid.Should().BeFalse();
            r.Result.Should().Be(SVersionBound.None);
        }
Esempio n. 2
0
        public void parse_npm_syntax(string p, string includePrerelease, string expected, string approximate)
        {
            var r = SVersionBound.NpmTryParse(p, includePrerelease == "includePrerelease");

            r.Error.Should().BeNull();
            r.Result.ToString().Should().Be(expected);
            r.IsApproximated.Should().Be(approximate == "Approx");
        }
Esempio n. 3
0
        public void parse_npm_with_fourth_part_skips_parts_and_prerelease(string p, string expected)
        {
            ReadOnlySpan <char> head = p;
            var r = SVersionBound.NpmTryParse(ref head);

            r.Error.Should().BeNull();
            r.Result.ToString().Should().Be(expected);
            r.FourthPartLost.Should().BeTrue();
            head.Length.Should().Be(0);
        }