2021-05-08 18:31:02 +00:00
|
|
|
const expect = require('expect');
|
|
|
|
const caesar = require('./caesar')
|
2017-08-25 18:59:26 +00:00
|
|
|
|
2021-05-08 18:31:02 +00:00
|
|
|
describe('caesar', function() {
|
|
|
|
test('works with single letters', function() {
|
|
|
|
expect(caesar('A', 1)).toBe('B');
|
2021-05-08 18:25:04 +00:00
|
|
|
});
|
2021-05-08 18:31:02 +00:00
|
|
|
test.skip('works with words', function() {
|
|
|
|
expect(caesar('Aaa', 1)).toBe('Bbb');
|
2021-05-08 18:25:04 +00:00
|
|
|
});
|
2021-05-08 18:31:02 +00:00
|
|
|
test.skip('works with phrases', function() {
|
|
|
|
expect(caesar('Hello, World!', 5)).toBe('Mjqqt, Btwqi!');
|
2021-05-08 18:25:04 +00:00
|
|
|
});
|
2021-05-08 18:31:02 +00:00
|
|
|
test.skip('works with negative shift', function() {
|
|
|
|
expect(caesar('Mjqqt, Btwqi!', -5)).toBe('Hello, World!');
|
2021-05-08 18:25:04 +00:00
|
|
|
});
|
2021-05-08 18:31:02 +00:00
|
|
|
test.skip('wraps', function() {
|
|
|
|
expect(caesar('Z', 1)).toBe('A');
|
2021-05-08 18:25:04 +00:00
|
|
|
});
|
2021-05-08 18:31:02 +00:00
|
|
|
test.skip('works with large shift factors', function() {
|
|
|
|
expect(caesar('Hello, World!', 75)).toBe('Ebiil, Tloia!');
|
2021-05-08 18:25:04 +00:00
|
|
|
});
|
2021-05-08 18:31:02 +00:00
|
|
|
test.skip('works with large negative shift factors', function() {
|
|
|
|
expect(caesar('Hello, World!', -29)).toBe('Ebiil, Tloia!');
|
2021-05-08 18:25:04 +00:00
|
|
|
});
|
2017-08-25 18:59:26 +00:00
|
|
|
});
|