Skip to content

Instantly share code, notes, and snippets.

@JustDravee
Created September 23, 2019 12:57
Show Gist options
  • Save JustDravee/e44f1a8f288673af8fe7b85be18043a3 to your computer and use it in GitHub Desktop.
Save JustDravee/e44f1a8f288673af8fe7b85be18043a3 to your computer and use it in GitHub Desktop.
import 'package:interview_algorithms_dart/palindrome-le-plus-long.dart';
import 'package:test/test.dart';
void main() {
test("Chaîne vide", () {
expect(palindromeLePlusLong(""), "");
});
test("Chaîne entière", () {
expect(palindromeLePlusLong("lol"), "lol");
});
test("Caractère unique", () {
expect(palindromeLePlusLong("a"), "a");
});
test("Phrase avec espaces, majuscule et ponctuation au milieu", () {
expect(palindromeLePlusLong("No lemon, no melon"), "No lemon, no melon");
});
test("Palindrome pair", () {
expect(palindromeLePlusLong("abba"), "abba");
});
test("Palindrome impair", () {
expect(palindromeLePlusLong("aba"), "aba");
});
test("Palindrome répété", () {
expect(palindromeLePlusLong("lolablol"), "lol");
});
test("Deux palindromes", () {
expect(palindromeLePlusLong("lolroxxxor"), "roxxxor");
});
test("Début de chaîne", () {
expect(palindromeLePlusLong("lolahbon"), "lol");
});
test("Milieu de chaîne", () {
expect(palindromeLePlusLong("ahlolserieux"), "lol");
});
test("Fin de chaîne", () {
expect(palindromeLePlusLong("superlol"), "lol");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment