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