-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathisogram.spec.js
More file actions
51 lines (39 loc) · 1.43 KB
/
Copy pathisogram.spec.js
File metadata and controls
51 lines (39 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { isIsogram } from './isogram';
describe('Isogram Test Suite', () => {
test('empty string', () => {
expect(isIsogram('')).toEqual(true);
});
test('isogram with only lower case characters', () => {
expect(isIsogram('isogram')).toEqual(true);
});
test('word with one duplicated character', () => {
expect(isIsogram('eleven')).toEqual(false);
});
test('word with one duplicated character from the end of the alphabet', () => {
expect(isIsogram('zzyzx')).toEqual(false);
});
test('longest reported english isogram', () => {
expect(isIsogram('subdermatoglyphic')).toEqual(true);
});
test('word with duplicated character in mixed case', () => {
expect(isIsogram('Alphabet')).toEqual(false);
});
test('word with duplicated character in mixed case, lowercase first', () => {
expect(isIsogram('alphAbet')).toEqual(false);
});
test('hypothetical isogrammic word with hyphen', () => {
expect(isIsogram('thumbscrew-japingly')).toEqual(true);
});
test('isogram with duplicated hyphen', () => {
expect(isIsogram('six-year-old')).toEqual(true);
});
test('made-up name that is an isogram', () => {
expect(isIsogram('Emily Jung Schwartzkopf')).toEqual(true);
});
test('duplicated character in the middle', () => {
expect(isIsogram('accentor')).toEqual(false);
});
test('same first and last characters', () => {
expect(isIsogram('angola')).toEqual(false);
});
});