forked from axross/leetcode-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlongest_palindrome_test.ts
19 lines (18 loc) · 1.5 KB
/
longest_palindrome_test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { test } from "https://deno.land/std/testing/mod.ts";
import { assert } from "https://deno.land/std/testing/asserts.ts";
import longestPalindrome from "./longest_palindrome.ts";
test("409. Longest Palindrome", () => {
assert(longestPalindrome("abccccdd") === 7);
assert(longestPalindrome("bb") === 2);
assert(longestPalindrome("aaaAaaaa") === 7);
assert(
longestPalindrome(
"zeusnilemacaronimaisanitratetartinasiaminoracamelinsuez"
) === 55
);
assert(
longestPalindrome(
"civilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateaportionofthatfieldasafinalrestingplaceforthosewhoheregavetheirlivesthatthatnationmightliveItisaltogetherfangandproperthatweshoulddothisButinalargersensewecannotdedicatewecannotconsecratewecannothallowthisgroundThebravelmenlivinganddeadwhostruggledherehaveconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadswfilllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetwhattheydidhereItisforusthelivingrathertobededicatedheretotheulnfinishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedItisratherforustobeherededicatedtothegreattdafskremainingbeforeusthatfromthesehonoreddeadwetakeincreaseddevotiontothatcauseforwhichtheygavethelastpfullmeasureofdevotionthatweherehighlyresolvethatthesedeadshallnothavediedinvainthatthisnationunsderGodshallhaveanewbirthoffreedomandthatgovernmentofthepeoplebythepeopleforthepeopleshallnotperishfromtheearth"
) === 983
);
});