Skip to content

Commit 525ec5b

Browse files
author
FELIPE EDUARDO MORSCHEL
committed
Added three more tests returning it
1 parent b5bf1f0 commit 525ec5b

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

test/time_test.dart

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,13 +725,36 @@ void main() {
725725
);
726726
},
727727
);
728-
test(
729-
'returns it when is longer than min and shorter than max',
728+
group(
729+
'returns it',
730730
() {
731731
final it = Duration(days: 0);
732732
final min = Duration(days: -5);
733733
final max = Duration(days: 5);
734-
expect(it.clamp(min: min, max: max), equals(it));
734+
test(
735+
'when both min and max are null',
736+
() {
737+
expect(it.clamp(), equals(it));
738+
},
739+
);
740+
test(
741+
'when is longer than min and max is null',
742+
() {
743+
expect(it.clamp(min: min), equals(it));
744+
},
745+
);
746+
test(
747+
'when is shorter than max and min is null',
748+
() {
749+
expect(it.clamp(max: max), equals(it));
750+
},
751+
);
752+
test(
753+
'when is longer than min and shorter than max',
754+
() {
755+
expect(it.clamp(min: min, max: max), equals(it));
756+
},
757+
);
735758
},
736759
);
737760
test(

0 commit comments

Comments
 (0)