mirror of
https://github.com/denoland/deno.git
synced 2025-09-29 13:44:47 +00:00
parent
d29957ad17
commit
e36edfdb3f
59 changed files with 893 additions and 891 deletions
|
@ -4,14 +4,15 @@ import {
|
|||
bytesEqual,
|
||||
bytesHasPrefix
|
||||
} from "./bytes.ts";
|
||||
import { assertEqual, test } from "./deps.ts";
|
||||
import { test } from "../testing/mod.ts";
|
||||
import { assertEq } from "../testing/asserts.ts";
|
||||
|
||||
test(function bytesBytesFindIndex() {
|
||||
const i = bytesFindIndex(
|
||||
new Uint8Array([1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 3]),
|
||||
new Uint8Array([0, 1, 2])
|
||||
);
|
||||
assertEqual(i, 2);
|
||||
assertEq(i, 2);
|
||||
});
|
||||
|
||||
test(function bytesBytesFindLastIndex1() {
|
||||
|
@ -19,7 +20,7 @@ test(function bytesBytesFindLastIndex1() {
|
|||
new Uint8Array([0, 1, 2, 0, 1, 2, 0, 1, 3]),
|
||||
new Uint8Array([0, 1, 2])
|
||||
);
|
||||
assertEqual(i, 3);
|
||||
assertEq(i, 3);
|
||||
});
|
||||
|
||||
test(function bytesBytesBytesEqual() {
|
||||
|
@ -27,10 +28,10 @@ test(function bytesBytesBytesEqual() {
|
|||
new Uint8Array([0, 1, 2, 3]),
|
||||
new Uint8Array([0, 1, 2, 3])
|
||||
);
|
||||
assertEqual(v, true);
|
||||
assertEq(v, true);
|
||||
});
|
||||
|
||||
test(function bytesBytesHasPrefix() {
|
||||
const v = bytesHasPrefix(new Uint8Array([0, 1, 2]), new Uint8Array([0, 1]));
|
||||
assertEqual(v, true);
|
||||
assertEq(v, true);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue