File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import 'medium/49.group_anagrams.test.dart' as group_anagrams;
3131import 'medium/5.longest_palindromic_substring.test.dart' as longest_palindromic_substring;
3232import 'medium/516.longest_palindromic_subsequence.test.dart' as longest_palindromic_subsequence;
3333import 'medium/647.palindromic_substrings.test.dart' as palindromic_substrings;
34+ import 'medium/8.string_to_integer_atoi.test.dart' as string_to_integer_atoi;
3435import 'medium/912.sort_an_array.test.dart' as sort_an_array;
3536
3637void main () {
@@ -64,5 +65,6 @@ void main() {
6465 longest_palindromic_substring.main ();
6566 palindromic_substrings.main ();
6667 longest_palindromic_subsequence.main ();
68+ string_to_integer_atoi.main ();
6769 });
6870}
Original file line number Diff line number Diff line change 1+ import 'package:leetcode/src/medium/8.string_to_integer_atoi/main.dart' ;
2+ import 'package:test/test.dart' ;
3+
4+ void main () {
5+ group ('longest_palindromic_substring' , () {
6+ final f = Solution ().myAtoi;
7+
8+ test ('f("")' , () {
9+ expect (f ('' ), equals (0 ));
10+ });
11+
12+ test ('f(" ")' , () {
13+ expect (f (' ' ), equals (0 ));
14+ });
15+
16+ test ('f("-2147483648")' , () {
17+ expect (f ('-2147483648' ), equals (- 2147483648 ));
18+ });
19+
20+ test ('f("9223372036854775808")' , () {
21+ expect (f ('9223372036854775808' ), equals (2147483647 ));
22+ });
23+
24+ test ('f("words and 987")' , () {
25+ expect (f ('words and 987' ), equals (0 ));
26+ });
27+
28+ test ('f("42")' , () {
29+ expect (f ('42' ), equals (42 ));
30+ });
31+
32+ test ('f("+-12")' , () {
33+ expect (f ('+-12' ), equals (0 ));
34+ });
35+
36+ test ('f(" -42")' , () {
37+ expect (f (' -42' ), equals (- 42 ));
38+ });
39+
40+ test ('f("+4193 with words")' , () {
41+ expect (f ('+4193 with words' ), equals (4193 ));
42+ });
43+ }); // group 'longest_palindromic_substring'
44+ }
You can’t perform that action at this time.
0 commit comments