Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(bytes): fix typo in test description #6179

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions bytes/index_of_needle_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
import { indexOfNeedle } from "./index_of_needle.ts";
import { assertEquals } from "@std/assert";

Deno.test("indexOfNeedle() handles repeating occurence", () => {
Deno.test("indexOfNeedle() handles repeating occurrence", () => {
const i = indexOfNeedle(
new Uint8Array([1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 3]),
new Uint8Array([0, 1, 2]),
);
assertEquals(i, 2);
});

Deno.test("indexOfNeedle() handles single occurence", () => {
Deno.test("indexOfNeedle() handles single occurrence", () => {
const i = indexOfNeedle(new Uint8Array([0, 0, 1]), new Uint8Array([0, 1]));
assertEquals(i, 1);
});

Deno.test("indexOfNeedle() handles text encoded occurence", () => {
Deno.test("indexOfNeedle() handles text encoded occurrence", () => {
const encoder = new TextEncoder();
const i = indexOfNeedle(encoder.encode("Deno"), encoder.encode("D"));
assertEquals(i, 0);
});

Deno.test("indexOfNeedle() handles missing occurence", () => {
Deno.test("indexOfNeedle() handles missing occurrence", () => {
const i = indexOfNeedle(new Uint8Array(), new Uint8Array([0, 1]));
assertEquals(i, -1);
});

Deno.test("indexOfNeedle() returns index of occurence after start", () => {
Deno.test("indexOfNeedle() returns index of occurrence after start", () => {
const i = indexOfNeedle(
new Uint8Array([0, 1, 2, 0, 1, 2]),
new Uint8Array([0, 1]),
Expand All @@ -35,7 +35,7 @@ Deno.test("indexOfNeedle() returns index of occurence after start", () => {
assertEquals(i, 3);
});

Deno.test("indexOfNeedle() returns -1 if occurence is before start", () => {
Deno.test("indexOfNeedle() returns -1 if occurrence is before start", () => {
const i = indexOfNeedle(
new Uint8Array([0, 1, 2, 0, 1, 2]),
new Uint8Array([0, 1]),
Expand Down
8 changes: 4 additions & 4 deletions bytes/last_index_of_needle_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
import { assertEquals } from "@std/assert";
import { lastIndexOfNeedle } from "./last_index_of_needle.ts";

Deno.test("lastIndexOfNeedle1() handles repeating occurence", () => {
Deno.test("lastIndexOfNeedle() handles repeating occurrence", () => {
const i = lastIndexOfNeedle(
new Uint8Array([0, 1, 2, 0, 1, 2, 0, 1, 3]),
new Uint8Array([0, 1, 2]),
);
assertEquals(i, 3);
});

Deno.test("lastIndexOfNeedle() handles single occurence", () => {
Deno.test("lastIndexOfNeedle() handles single occurrence", () => {
const i = lastIndexOfNeedle(
new Uint8Array([0, 1, 1]),
new Uint8Array([0, 1]),
);
assertEquals(i, 0);
});

Deno.test("lastIndexOfNeedle() handles missing occurence", () => {
Deno.test("lastIndexOfNeedle() handles missing occurrence", () => {
const i = lastIndexOfNeedle(new Uint8Array(), new Uint8Array([0, 1]));
assertEquals(i, -1);
});

Deno.test("lastIndexOfNeedle() returns index of occurence after start", () => {
Deno.test("lastIndexOfNeedle() returns index of occurrence after start", () => {
const i = lastIndexOfNeedle(
new Uint8Array([0, 1, 2, 0, 1, 2]),
new Uint8Array([0, 1]),
Expand Down
Loading