-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
16 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class Isogram | ||
isIsogram: (phrase) -> | ||
@isIsogram: (phrase) -> | ||
|
||
module.exports = Isogram |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,72 @@ | ||
Isogram = require './isogram' | ||
|
||
describe 'Isogram', -> | ||
iso = new Isogram() | ||
it 'empty string', -> | ||
phrase = '' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual true | ||
|
||
xit 'isogram with only lower case characters', -> | ||
phrase = 'isogram' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual true | ||
|
||
xit 'word with one duplicated character', -> | ||
phrase = 'eleven' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual false | ||
|
||
xit 'word with one duplicated character from the end of the alphabet', -> | ||
phrase = 'zzyzx' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual false | ||
|
||
xit 'longest reported english isogram', -> | ||
phrase = 'subdermatoglyphic' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual true | ||
|
||
xit 'word with duplicated character in mixed case', -> | ||
phrase = 'Alphabet' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual false | ||
|
||
xit 'word with duplicated character in mixed case, lowercase first', -> | ||
phrase = 'alphAbet' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual false | ||
|
||
xit 'hypothetical isogrammic word with hyphen', -> | ||
phrase = 'thumbscrew-japingly' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual true | ||
|
||
xit 'hypothetical word with duplicated character following hyphen', -> | ||
phrase = 'thumbscrew-jappingly' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual false | ||
|
||
xit 'isogram with duplicated hyphen', -> | ||
phrase = 'six-year-old' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual true | ||
|
||
xit 'made-up name that is an isogram', -> | ||
phrase = 'Emily Jung Schwartzkopf' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual true | ||
|
||
xit 'duplicated character in the middle', -> | ||
phrase = 'accentor' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual false | ||
|
||
xit 'same first and last characters', -> | ||
phrase = 'angola' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual false | ||
|
||
xit 'word with duplicated character and with two hyphens', -> | ||
phrase = 'up-to-date' | ||
result = iso.isIsogram(phrase) | ||
result = Isogram.isIsogram(phrase) | ||
expect(result).toEqual false |