17 lines
575 B
Dart
17 lines
575 B
Dart
|
|
import 'package:flutter_test/flutter_test.dart';
|
||
|
|
import 'package:halkyon_ui/halkyon_ui.dart';
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
test('steps go to the next multiple of the step, never below the first', () {
|
||
|
|
expect(stepUp(12, 5, max: 100), 15);
|
||
|
|
expect(stepUp(15, 5, max: 100), 20);
|
||
|
|
expect(stepUp(98, 5, max: 100), 100);
|
||
|
|
expect(stepDown(12, 5), 10);
|
||
|
|
expect(stepDown(15, 5), 10);
|
||
|
|
expect(stepDown(7, 5), 5);
|
||
|
|
expect(canStepDown(5, 5), isFalse);
|
||
|
|
expect(canStepDown(6, 5), isTrue);
|
||
|
|
expect(stepUp(1, 25, max: 1000), 25);
|
||
|
|
expect(stepDown(230, 25), 225);
|
||
|
|
});
|
||
|
|
}
|