import unittest

from acronym import abbreviate


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.4.0

class AcronymTest(unittest.TestCase):
    def test_basic(self):
        self.assertEqual(abbreviate('Portable Network Graphics'), 'PNG')

    def test_lowercase_words(self):
        self.assertEqual(abbreviate('Ruby on Rails'), 'ROR')

    def test_punctuation(self):
        self.assertEqual(abbreviate('First In, First Out'), 'FIFO')

    def test_all_caps_words(self):
        self.assertEqual(abbreviate('GNU Image Manipulation Program'), 'GIMP')

    def test_punctuation_without_whitespace(self):
        self.assertEqual(
            abbreviate('Complementary metal-oxide semiconductor'), 'CMOS')

    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")


if __name__ == '__main__':
    unittest.main()

import unittest

from acronym import abbreviate


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.5.0

class AcronymTest(unittest.TestCase):
    def test_basic(self):
        self.assertEqual(abbreviate('Portable Network Graphics'), 'PNG')

    def test_lowercase_words(self):
        self.assertEqual(abbreviate('Ruby on Rails'), 'ROR')

    def test_punctuation(self):
        self.assertEqual(abbreviate('First In, First Out'), 'FIFO')

    def test_all_caps_words(self):
        self.assertEqual(abbreviate('GNU Image Manipulation Program'), 'GIMP')

    def test_punctuation_without_whitespace(self):
        self.assertEqual(
            abbreviate('Complementary metal-oxide semiconductor'), 'CMOS')

    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_consecutive_delimiters(self):
        self.assertEqual(
            abbreviate('Something - I made up from thin air'), 'SIMUFTA')


if __name__ == '__main__':
    unittest.main()

Update tests to v1.5.0 (#1541)