Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 473916a

Browse files
Tests for 5. Longest Palindromic Substring
1 parent f5d8f72 commit 473916a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎test/medium/5.longest_palindromic_substring.test.dart‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ void main() {
1818
expect(f('cbbd'), equals('bb'));
1919
});
2020

21-
test('returns input string for input with no palindromes', () {
22-
expect(f('abc'), anyOf(equals('a'), equals('b'), equals('c')));
21+
test('returns longest palindromic substring for alphanumeric input', () {
22+
expect(f('a1b2c3d3c2b1a'), equals('a1b2c3d3c2b1a'));
23+
expect(f('racecar12321'), equals('racecar'));
24+
});
25+
26+
test('returns input string for alphanumeric input with no palindromes', () {
27+
expect(f('abc123'), anyOf(equals('a'), equals('b'), equals('c'), equals('1'), equals('2'), equals('3')));
2328
});
2429
}); // group 'longest_palindromic_substring'
2530
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /