Mark caesar as archived and move archived exercise to own folder (#336)

This commit is contained in:
Asartea
2023-03-18 22:45:37 +01:00
committed by GitHub
parent 6f5f71ff5b
commit 75869d1912
15 changed files with 0 additions and 0 deletions
@@ -0,0 +1,23 @@
const caesar = require('./caesar-solution');
test('works with single letters', () => {
expect(caesar('A', 1)).toBe('B');
});
test('works with words', () => {
expect(caesar('Aaa', 1)).toBe('Bbb');
});
test('works with phrases', () => {
expect(caesar('Hello, World!', 5)).toBe('Mjqqt, Btwqi!');
});
test('works with negative shift', () => {
expect(caesar('Mjqqt, Btwqi!', -5)).toBe('Hello, World!');
});
test('wraps', () => {
expect(caesar('Z', 1)).toBe('A');
});
test('works with large shift factors', () => {
expect(caesar('Hello, World!', 75)).toBe('Ebiil, Tloia!');
});
test('works with large negative shift factors', () => {
expect(caesar('Hello, World!', -29)).toBe('Ebiil, Tloia!');
});