blob: 34ca9347e07d9504a9ec142e1d3499b6fc247aac [file] [log] [blame]
import 'package:checks/context.dart';
extension NumChecks on Check<num> {
void operator >(num other) {
context.expect(() => ['is greater than ${literal(other)}'], (actual) {
if (actual > other) return null;
return Rejection(
actual: literal(actual),
which: ['Is not greater than ${literal(other)}']);
});
}
void operator <(num other) {
context.expect(() => ['is less than ${literal(other)}'], (actual) {
if (actual < other) return null;
return Rejection(
actual: literal(actual),
which: ['Is not less than ${literal(other)}']);
});
}
}