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

This commit is contained in:
Yongjoon Lee 2024-11-09 22:15:09 +09:00 committed by GitHub
parent bf0ad522e8
commit 69858cfd7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 10 deletions

View File

@ -2,7 +2,7 @@
import { indexOfNeedle } from "./index_of_needle.ts"; import { indexOfNeedle } from "./index_of_needle.ts";
import { assertEquals } from "@std/assert"; import { assertEquals } from "@std/assert";
Deno.test("indexOfNeedle() handles repeating occurence", () => { Deno.test("indexOfNeedle() handles repeating occurrence", () => {
const i = indexOfNeedle( const i = indexOfNeedle(
new Uint8Array([1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 3]), new Uint8Array([1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 3]),
new Uint8Array([0, 1, 2]), new Uint8Array([0, 1, 2]),
@ -10,23 +10,23 @@ Deno.test("indexOfNeedle() handles repeating occurence", () => {
assertEquals(i, 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])); const i = indexOfNeedle(new Uint8Array([0, 0, 1]), new Uint8Array([0, 1]));
assertEquals(i, 1); assertEquals(i, 1);
}); });
Deno.test("indexOfNeedle() handles text encoded occurence", () => { Deno.test("indexOfNeedle() handles text encoded occurrence", () => {
const encoder = new TextEncoder(); const encoder = new TextEncoder();
const i = indexOfNeedle(encoder.encode("Deno"), encoder.encode("D")); const i = indexOfNeedle(encoder.encode("Deno"), encoder.encode("D"));
assertEquals(i, 0); assertEquals(i, 0);
}); });
Deno.test("indexOfNeedle() handles missing occurence", () => { Deno.test("indexOfNeedle() handles missing occurrence", () => {
const i = indexOfNeedle(new Uint8Array(), new Uint8Array([0, 1])); const i = indexOfNeedle(new Uint8Array(), new Uint8Array([0, 1]));
assertEquals(i, -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( const i = indexOfNeedle(
new Uint8Array([0, 1, 2, 0, 1, 2]), new Uint8Array([0, 1, 2, 0, 1, 2]),
new Uint8Array([0, 1]), new Uint8Array([0, 1]),
@ -35,7 +35,7 @@ Deno.test("indexOfNeedle() returns index of occurence after start", () => {
assertEquals(i, 3); 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( const i = indexOfNeedle(
new Uint8Array([0, 1, 2, 0, 1, 2]), new Uint8Array([0, 1, 2, 0, 1, 2]),
new Uint8Array([0, 1]), new Uint8Array([0, 1]),

View File

@ -2,7 +2,7 @@
import { assertEquals } from "@std/assert"; import { assertEquals } from "@std/assert";
import { lastIndexOfNeedle } from "./last_index_of_needle.ts"; import { lastIndexOfNeedle } from "./last_index_of_needle.ts";
Deno.test("lastIndexOfNeedle1() handles repeating occurence", () => { Deno.test("lastIndexOfNeedle() handles repeating occurrence", () => {
const i = lastIndexOfNeedle( const i = lastIndexOfNeedle(
new Uint8Array([0, 1, 2, 0, 1, 2, 0, 1, 3]), new Uint8Array([0, 1, 2, 0, 1, 2, 0, 1, 3]),
new Uint8Array([0, 1, 2]), new Uint8Array([0, 1, 2]),
@ -10,7 +10,7 @@ Deno.test("lastIndexOfNeedle1() handles repeating occurence", () => {
assertEquals(i, 3); assertEquals(i, 3);
}); });
Deno.test("lastIndexOfNeedle() handles single occurence", () => { Deno.test("lastIndexOfNeedle() handles single occurrence", () => {
const i = lastIndexOfNeedle( const i = lastIndexOfNeedle(
new Uint8Array([0, 1, 1]), new Uint8Array([0, 1, 1]),
new Uint8Array([0, 1]), new Uint8Array([0, 1]),
@ -18,12 +18,12 @@ Deno.test("lastIndexOfNeedle() handles single occurence", () => {
assertEquals(i, 0); assertEquals(i, 0);
}); });
Deno.test("lastIndexOfNeedle() handles missing occurence", () => { Deno.test("lastIndexOfNeedle() handles missing occurrence", () => {
const i = lastIndexOfNeedle(new Uint8Array(), new Uint8Array([0, 1])); const i = lastIndexOfNeedle(new Uint8Array(), new Uint8Array([0, 1]));
assertEquals(i, -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( const i = lastIndexOfNeedle(
new Uint8Array([0, 1, 2, 0, 1, 2]), new Uint8Array([0, 1, 2, 0, 1, 2]),
new Uint8Array([0, 1]), new Uint8Array([0, 1]),