deno.land / std@0.166.0 / semver / tooLong_test.ts

tooLong_test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright Isaac Z. Schlueter and Contributors. All rights reserved. ISC license.// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.import { assertEquals, assertThrows } from "../testing/asserts.ts";import * as semver from "./mod.ts";
Deno.test("versionIsTooLong", function () { const v: string = "1.2." + new Array(256).join("1");
assertThrows(function () { new semver.SemVer(v); }); assertEquals(semver.valid(v), null); assertEquals(semver.increment(v, "patch"), null);});
Deno.test("tooBig", function () { const v = "1.2." + new Array(100).join("1"); assertThrows(function () { new semver.SemVer(v); }); assertEquals(semver.valid(v), null); assertEquals(semver.increment(v, "patch"), null);});
Deno.test("parsingNullDoesNotThrow", function () { assertEquals(semver.parse(null), null); assertEquals(semver.parse({} as semver.SemVer), null); assertEquals(semver.parse(new semver.SemVer("1.2.3"))!.version, "1.2.3");});
std
Deno standard library
GitHub Repositorydenoland/deno_std
GitHub Stars
2458

Version Info

Tagged at
2 months ago