Skip to content

Commit

Permalink
test(bytes): fix typo in test description (#6179)
Browse files Browse the repository at this point in the history
  • Loading branch information
BinskLee authored Nov 9, 2024
1 parent bf0ad52 commit 69858cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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

0 comments on commit 69858cf

Please sign in to comment.