File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -623,13 +623,36 @@ void main() {
623
623
);
624
624
},
625
625
);
626
- test (
627
- 'returns it when is after min and before max ' ,
626
+ group (
627
+ 'returns it' ,
628
628
() {
629
629
final it = DateTime (2022 , DateTime .september, 1 );
630
630
final min = DateTime (2022 , DateTime .august, 1 );
631
631
final max = DateTime (2022 , DateTime .september, 30 );
632
- expect (it.clamp (min: min, max: max), equals (it));
632
+ test (
633
+ 'when both min and max are null' ,
634
+ () {
635
+ expect (it.clamp (), equals (it));
636
+ },
637
+ );
638
+ test (
639
+ 'when is longer than min and max is null' ,
640
+ () {
641
+ expect (it.clamp (min: min), equals (it));
642
+ },
643
+ );
644
+ test (
645
+ 'when is shorter than max and min is null' ,
646
+ () {
647
+ expect (it.clamp (max: max), equals (it));
648
+ },
649
+ );
650
+ test (
651
+ 'when is longer than min and shorter than max' ,
652
+ () {
653
+ expect (it.clamp (min: min, max: max), equals (it));
654
+ },
655
+ );
633
656
},
634
657
);
635
658
test (
You can’t perform that action at this time.
0 commit comments