Skip to content

Commit 11a2359

Browse files
authored
Merge pull request #38 from fartem/tests-1
2025-05-08 v. 1.0.9: refactored tests
2 parents 0c51962 + 5004d75 commit 11a2359

32 files changed

+91
-86
lines changed

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: leetcode_dart
22
description: Some solved problems from https://leetcode.com on Dart
3-
version: 1.0.8
3+
version: 1.0.9
44
homepage: https://github.com/fartem/leetcode-dart
55

66
environment:

test/easy/100_same_tree_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void main() {
99
final solution = Solution();
1010

1111
test(
12-
'true',
12+
'Test case 1',
1313
() => expect(
1414
true,
1515
solution.isSameTree(
@@ -27,7 +27,7 @@ void main() {
2727
),
2828
);
2929
test(
30-
'false',
30+
'Test case 2',
3131
() => expect(
3232
false,
3333
solution.isSameTree(
@@ -44,7 +44,7 @@ void main() {
4444
),
4545
);
4646
test(
47-
'false',
47+
'Test case 3',
4848
() => expect(
4949
false,
5050
solution.isSameTree(

test/easy/101_symmetric_tree_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void main() {
99
final solution = Solution();
1010

1111
test(
12-
'true',
12+
'Test case 1',
1313
() => expect(
1414
true,
1515
solution.isSymmetric(
@@ -30,7 +30,7 @@ void main() {
3030
),
3131
);
3232
test(
33-
'false',
33+
'Test case 2',
3434
() => expect(
3535
false,
3636
solution.isSymmetric(

test/easy/104_maximum_depth_of_binary_tree_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void main() {
99
final solution = Solution();
1010

1111
test(
12-
'3',
12+
'Test case 1',
1313
() => expect(
1414
3,
1515
solution.maxDepth(
@@ -26,7 +26,7 @@ void main() {
2626
),
2727
);
2828
test(
29-
'2',
29+
'Test case 2',
3030
() => expect(
3131
2,
3232
solution.maxDepth(

test/easy/108_convert_sorted_array_to_binary_search_tree_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void main() {
1111
final solution = Solution();
1212

1313
test(
14-
'[0, -10, 5, null, -3, null, 9]',
14+
'Test case 1',
1515
() => expect(
1616
true,
1717
BinaryTreeHelper.areEqual(
@@ -35,7 +35,7 @@ void main() {
3535
),
3636
);
3737
test(
38-
'3, null, 1',
38+
'Test case 2',
3939
() => expect(
4040
true,
4141
BinaryTreeHelper.areEqual(

test/easy/110_balanced_binary_tree_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void main() {
99
final solution = Solution();
1010

1111
test(
12-
'true',
12+
'Test case 1',
1313
() => expect(
1414
true,
1515
solution.isBalanced(
@@ -26,7 +26,7 @@ void main() {
2626
),
2727
);
2828
test(
29-
'false',
29+
'Test case 2',
3030
() => expect(
3131
false,
3232
solution.isBalanced(

test/easy/111_minimum_depth_of_binary_tree_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void main() {
99
final solution = Solution();
1010

1111
test(
12-
'2',
12+
'Test case 1',
1313
() => expect(
1414
2,
1515
solution.minDepth(
@@ -26,7 +26,7 @@ void main() {
2626
),
2727
);
2828
test(
29-
'5',
29+
'Test case 2',
3030
() => expect(
3131
5,
3232
solution.minDepth(

test/easy/112_path_sum_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void main() {
99
final solution = Solution();
1010

1111
test(
12-
'true',
12+
'Test case 1',
1313
() => expect(
1414
true,
1515
solution.hasPathSum(
@@ -41,7 +41,7 @@ void main() {
4141
),
4242
);
4343
test(
44-
'false',
44+
'Test case 2',
4545
() => expect(
4646
false,
4747
solution.hasPathSum(
@@ -55,7 +55,7 @@ void main() {
5555
),
5656
);
5757
test(
58-
'false',
58+
'Test case 3',
5959
() => expect(
6060
false,
6161
solution.hasPathSum(

test/easy/118_pascals_triangle_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ void main() {
88
final solution = Solution();
99

1010
test(
11-
'[[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1]]',
11+
'Test case 1',
1212
() => expect(
1313
[
1414
[1],
@@ -21,7 +21,7 @@ void main() {
2121
),
2222
);
2323
test(
24-
'[1]',
24+
'Test case 2',
2525
() => expect(
2626
[
2727
[1],

test/easy/13_roman_to_integer_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ void main() {
88
final solution = Solution();
99

1010
test(
11-
'3',
11+
'Test case 1',
1212
() => expect(
1313
3,
1414
solution.romanToInt('III'),
1515
),
1616
);
1717
test(
18-
'58',
18+
'Test case 2',
1919
() => expect(
2020
58,
2121
solution.romanToInt('LVIII'),
2222
),
2323
);
2424
test(
25-
'1994',
25+
'Test case 3',
2626
() => expect(
2727
1994,
2828
solution.romanToInt('MCMXCIV'),

0 commit comments

Comments
 (0)