dist-javascript-algorithms-and-data-structures
Version:
Algorithms and data-structures implemented on JavaScript
60 lines (47 loc) • 1.24 kB
JavaScript
import squareMatrixRotation from '../squareMatrixRotation';
describe('squareMatrixRotation', () => {
it('should rotate matrix #0 in-place', () => {
const matrix = [[1]];
const rotatedMatrix = [[1]];
expect(squareMatrixRotation(matrix)).toEqual(rotatedMatrix);
});
it('should rotate matrix #1 in-place', () => {
const matrix = [
[],
[],
];
const rotatedMatrix = [
[],
[],
];
expect(squareMatrixRotation(matrix)).toEqual(rotatedMatrix);
});
it('should rotate matrix #2 in-place', () => {
const matrix = [
[],
[],
[],
];
const rotatedMatrix = [
[],
[],
[],
];
expect(squareMatrixRotation(matrix)).toEqual(rotatedMatrix);
});
it('should rotate matrix #3 in-place', () => {
const matrix = [
[],
[],
[],
[],
];
const rotatedMatrix = [
[],
[],
[],
[],
];
expect(squareMatrixRotation(matrix)).toEqual(rotatedMatrix);
});
});