Skip to content

Commit

Permalink
refactor(text): format test names (#3993)
Browse files Browse the repository at this point in the history
  • Loading branch information
timreichen authored Dec 20, 2023
1 parent fc1f3e4 commit c3cfce4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
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

0 comments on commit c3cfce4

Please sign in to comment.