RED: test roman numerals contraints

This commit is contained in:
fiatcode 2026-02-10 09:33:44 +07:00
parent 5dfc85fc20
commit 216aa72d39

View file

@ -66,5 +66,19 @@ void main() {
() => expect(integerToRoman(3999), 'MMMCMXCIX'),
);
});
group('Error Handling', () {
test('rejects zero', () {
expect(() => integerToRoman(0), throwsArgumentError);
});
test('rejects negative numbers', () {
expect(() => integerToRoman(-5), throwsArgumentError);
});
test('rejects numbers above 3999', () {
expect(() => integerToRoman(4000), throwsArgumentError);
});
});
});
}