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

refactor(text): format test names #3993

Merged
merged 4 commits into from
Dec 20, 2023
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
8 changes: 4 additions & 4 deletions text/closest_string_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { assertEquals, assertThrows } from "../assert/mod.ts";
import { closestString } from "./closest_string.ts";

Deno.test("closestString - basic", function () {
Deno.test("closestString() handles basic example", function () {
const words = ["hi", "hello", "help"];

assertEquals(
Expand All @@ -11,7 +11,7 @@ Deno.test("closestString - basic", function () {
);
});

Deno.test("closestString - caseSensitive1", function () {
Deno.test("closestString() handles case sensitive example 1", function () {
const words = ["hi", "hello", "help"];

// this is why caseSensitive is OFF by default; very unintuitive until something better than levenshtein_distance is used
Expand All @@ -21,7 +21,7 @@ Deno.test("closestString - caseSensitive1", function () {
);
});

Deno.test("closestString - caseSensitive2", function () {
Deno.test("closestString() handles case sensitive example 2", function () {
const words = ["HI", "HELLO", "HELP"];

assertEquals(
Expand All @@ -30,7 +30,7 @@ Deno.test("closestString - caseSensitive2", function () {
);
});

Deno.test("closestString - empty input", function () {
Deno.test("closestString() handles empty input", function () {
assertThrows(
() => closestString("he", []),
Error,
Expand Down
4 changes: 2 additions & 2 deletions text/compare_similarity_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { assertEquals } from "../assert/mod.ts";
import { compareSimilarity } from "./compare_similarity.ts";

Deno.test("compareSimilarity1", function () {
Deno.test("compareSimilarity() handles basic example 1", function () {
const words = ["hi", "hello", "help"];

assertEquals(
Expand All @@ -11,7 +11,7 @@ Deno.test("compareSimilarity1", function () {
);
});

Deno.test("compareSimilarity2", function () {
Deno.test("compareSimilarity() handles basic example 2", function () {
const words = ["hi", "hello", "help", "HOWDY"];

assertEquals(
Expand Down
4 changes: 2 additions & 2 deletions text/levenshtein_distance_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import { assertEquals } from "../assert/mod.ts";
import { levenshteinDistance } from "./mod.ts";

Deno.test("levenshteinDistanceAbove - basic cases", function () {
Deno.test("levenshteinDistance() handles basic cases", function () {
assertEquals(
levenshteinDistance("aa", "bb"),
2,
);
});

Deno.test("levenshteinDistance - same strings", function () {
Deno.test("levenshteinDistance() handles same strings", function () {
assertEquals(
levenshteinDistance("aa", "aa"),
0,
Expand Down
6 changes: 3 additions & 3 deletions text/word_similarity_sort_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { assertEquals } from "../assert/mod.ts";
import { wordSimilaritySort } from "./word_similarity_sort.ts";

Deno.test("basicWordSimilaritySort", function () {
Deno.test("wordSimilaritySort() handles basic example", function () {
const possibleWords: string[] = ["length", "size", "blah", "help"];
const badArg = "hep";
assertEquals(
Expand All @@ -11,7 +11,7 @@ Deno.test("basicWordSimilaritySort", function () {
);
});

Deno.test("emptyStringSimilaritySort", function () {
Deno.test("wordSimilaritySort() handles empty string", function () {
const possibleWords: string[] = ["length", "size", "blah", "help", ""];
const badArg = "";

Expand All @@ -21,7 +21,7 @@ Deno.test("emptyStringSimilaritySort", function () {
);
});

Deno.test("emptyArraySimilaritySort", function () {
Deno.test("wordSimilaritySort() handles empty array", function () {
const possibleWords: string[] = [];
const badArg = "";

Expand Down