From a13ea05ecfeba2274f9888cfa1dfecf474a32aef Mon Sep 17 00:00:00 2001 From: Syed Fasiuddin Date: Sun, 10 Oct 2021 12:34:10 +0530 Subject: [PATCH] adding test file for AlphaNumericPalindrome algorithm --- String/test/AlphaNumericPalindrome.test.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 String/test/AlphaNumericPalindrome.test.js diff --git a/String/test/AlphaNumericPalindrome.test.js b/String/test/AlphaNumericPalindrome.test.js new file mode 100644 index 000000000..a8de6dd6e --- /dev/null +++ b/String/test/AlphaNumericPalindrome.test.js @@ -0,0 +1,21 @@ +import { alphaNumericPlaindrome } from "../AlphanumericPalindrome"; + +test("should return true if the given string has alphanumeric characters that are palindrom irrespective of case and symbols", () => { + expect(alphaNumericPlaindrome("eye")).toBe(true) +}) + +test("should return true if the given string has alphanumeric characters that are palindrom irrespective of case and symbols", () => { + expect(alphaNumericPlaindrome("0_0 (: /-\ :) 0-0")).toBe(true) +}) + +test("should return true if the given string has alphanumeric characters that are palindrom irrespective of case and symbols", () => { + expect(alphaNumericPlaindrome("five|\_/|four")).toBe(false) +}) + +test("should return true if the given string has alphanumeric characters that are palindrom irrespective of case and symbols", () => { + expect(alphaNumericPlaindrome("A man, a plan, a canal. Panama")).toBe(true) +}) + +test("should return true if the given string has alphanumeric characters that are palindrom irrespective of case and symbols", () => { + expect(alphaNumericPlaindrome("1 eye for of 1 eye.")).toBe(false) +})