New tests for Rectangles
Suggest new tests for Rectangles, if it fits within the intent of the exercise. The tests are for rectangles that do not share sides with other existing rectangles.
test('separated rectangle, same size as other rectangle ', () => {
const expected = 4;
const actual = Rectangles.count([
' +-+',
' | |',
'+-+ +-+',
'| | | |',
'+-+ +-+',
]);
expect(actual).toEqual(expected);
});
test('separated rectangles, different sizes,no overlap ', () => {
const expected = 3;
const actual = Rectangles.count([
' +-+',
' | |',
' +-+',
'+-+ ',
'+-+ ',
' +---+ ',
' | | ',
' +---+ ',
]);
expect(actual).toEqual(expected);
});
test('separated rectangles, different sizes', () => {
const expected = 4;
const actual = Rectangles.count([
' +-+',
' | |',
' +-+',
'+-+ | |',
'| | | |',
'+-+ | |',
' +-+',
]);
expect(actual).toEqual(expected);
});
Due to #1560, I've put the suggestion on hold.
Until then we can discuss the merit of these additional tests here.
If you have a particular language track in mind (I can't guess exactly what language the examples are written in), feel free to open an issue or a pull request in that particular language track repo instead, or declare the language here; for example, if it had been Java, mentioning @exercism/java would ping current Java maintainers. Individual tracks are free to diverge from the canonical tests.