def test_very_long_abbreviation(self): self.assertEqual( abbreviate( "Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me" ), "ROTFLSHTMDCOALM", )
def test_basic2(self): for s, exp in [ ("Portable Network Graphics", "PNG"), ("Looks good to me", "LGTM"), ("Sounds 'good' to me", "SGTM"), ("Isn't it good", "IIG"), ("If and only if...", "IAOI"), ("Yet Another Funny Acronym", "YAFA"), ("Sometimes, it is necessary to raise an exception.", "SIINTRAE"), ("Last-in, first-out", "LIFO"), ('Oh my "Gosh!"', "OMG"), ("Functional Programming", "FP"), ("Imperative Programming", "IP"), ("Object oriented Programming", "OOP"), ("Differentiable Programming", "DP") ]: self.assertEqual(abbreviate(s), exp)
def test_basic(self): self.assertEqual(abbreviate('Portable Network Graphics'), 'PNG')
def test_basic(self): self.assertEqual('PNG', abbreviate('Portable Network Graphics'))
def test_punctuation(self): self.assertEqual(abbreviate('First In, First Out'), 'FIFO')
def test_camelcase(self): self.assertEqual('HTML', abbreviate('HyperText Markup Language'))
def test_all_caps_words(self): self.assertEqual('PHP', abbreviate('PHP: Hypertext Preprocessor'))
def test_basic(self): assert abbreviate("Portable Network Graphics") == "PNG"
def test_hyphenated(self): self.assertEqual( abbreviate('Complementary metal-oxide semiconductor'), 'CMOS')
def test_camelcase1(self): self.assertEqual('HFTZML', abbreviate('HyFperTextZ Markup Language'))
def test_apostrophes(self): self.assertEqual(abbreviate("Halley's Comet"), 'HC')
def test_underscore_emphasis(self): self.assertEqual(abbreviate("The Road _Not_ Taken"), 'TRNT')
def test_consecutive_delimiters(self): self.assertEqual( abbreviate('Something - I made up from thin air'), 'SIMUFTA')
def test_very_long_abbreviation(self): self.assertEqual( abbreviate("Rolling On The Floor Laughing So Hard That " "My Dogs Came Over And Licked Me"), "ROTFLSHTMDCOALM")
def test_lowercase_words(self): assert abbreviate("Ruby on Rails") == "ROR"
def test_punctuation(self): self.assertEqual(abbreviate("First In, First Out"), "FIFO")
def test_hyphenated2(self): self.assertEqual('CMOSC', abbreviate('Complementary metal-oxide semi--conductor'))
def test_punctuation_without_whitespace(self): self.assertEqual(abbreviate("Complementary metal-oxide semiconductor"), "CMOS")
def test_hyphenated3(self): self.assertEqual('ROR', abbreviate('rubyOn--Rails'))
def test_apostrophes(self): assert abbreviate("Halley's Comet") == "HC"
def test_punctuation_without_whitespace(self): self.assertEqual( abbreviate('Complementary metal-oxide semiconductor'), 'CMOS')
def test_lowercase_words(self): self.assertEqual('ROR', abbreviate('Ruby on Rails'))
def test_basic(self): self.assertEqual(abbreviate('Buenos Aires Ciudad'), 'BAC')
def test_punctuation(self): self.assertEqual('FIFO', abbreviate('First In, First Out'))
def test_lowercase_words(self): self.assertEqual(abbreviate("too long didn't read"), 'TLDR')
def test_hyphenated(self): self.assertEqual('CMOS', abbreviate('Complementary metal-oxide semiconductor'))
def test_punctuation(self): self.assertEqual(abbreviate("O'Lord Almighty, the Only one."), 'OATOO')
def test_lowercase_words(self): self.assertEqual(abbreviate('Ruby on Rails'), 'ROR')
def test_all_caps_words(self): self.assertEqual(abbreviate('WHAT YOU SEE IS WHAT YOU GET'), 'WYSIWYG')
def test_all_caps_words(self): self.assertEqual(abbreviate('GNU Image Manipulation Program'), 'GIMP')
def test_punctuation_without_whitespace(self): self.assertEqual(abbreviate('document-object-model'), 'DOM')
def test_lowercase_words(self): self.assertEqual(abbreviate("Ruby on Rails"), "ROR")
def test_consecutive_delimiters(self): self.assertEqual(abbreviate("Something - I made up from thin air"), "SIMUFTA")
def test_all_caps_word(self): self.assertEqual(abbreviate("GNU Image Manipulation Program"), "GIMP")
def test_underscore_emphasis(self): self.assertEqual(abbreviate("The Road _Not_ Taken"), "TRNT")
def test_very_long_abbreviation(self): self.assertEqual(abbreviate('Last Friday Night We Did it all again, Thank God its Friday'), 'LFNWDIAATGIF')
def test_underscore_emphasis(self): assert abbreviate("The Road _Not_ Taken") == "TRNT"
def test_apostrophes(self): self.assertEqual(abbreviate("Halley's Comet"), "HC")
def test_all_caps_words(self): self.assertEqual(abbreviate('PHP: Hypertext Preprocessor'), 'PHP')
def test_basic(self): self.assertEqual(abbreviate("Portable Network Graphics"), "PNG")
def test_non_acronym_all_caps_word(self): self.assertEqual(abbreviate('GNU Image Manipulation Program'), 'GIMP')