コード例 #1
0
 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",
     )
コード例 #2
0
 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)
コード例 #3
0
ファイル: acronym_test.py プロジェクト: Lordjiggyx/Excercism
 def test_basic(self):
     self.assertEqual(abbreviate('Portable Network Graphics'), 'PNG')
コード例 #4
0
ファイル: acronym_test.py プロジェクト: rootulp/exercism
 def test_basic(self):
     self.assertEqual('PNG', abbreviate('Portable Network Graphics'))
コード例 #5
0
ファイル: acronym_test.py プロジェクト: Lordjiggyx/Excercism
 def test_punctuation(self):
     self.assertEqual(abbreviate('First In, First Out'), 'FIFO')
コード例 #6
0
ファイル: acronym_test.py プロジェクト: rootulp/exercism
 def test_camelcase(self):
     self.assertEqual('HTML', abbreviate('HyperText Markup Language'))
コード例 #7
0
ファイル: acronym_test.py プロジェクト: rootulp/exercism
 def test_all_caps_words(self):
     self.assertEqual('PHP', abbreviate('PHP: Hypertext Preprocessor'))
コード例 #8
0
 def test_basic(self):
     assert abbreviate("Portable Network Graphics") == "PNG"
コード例 #9
0
 def test_hyphenated(self):
     self.assertEqual(
         abbreviate('Complementary metal-oxide semiconductor'), 'CMOS')
コード例 #10
0
 def test_camelcase(self):
     self.assertEqual('HTML', abbreviate('HyperText Markup Language'))
コード例 #11
0
 def test_camelcase1(self):
     self.assertEqual('HFTZML', abbreviate('HyFperTextZ Markup Language'))
コード例 #12
0
ファイル: acronym_test.py プロジェクト: NSteinhoff/exercism
 def test_apostrophes(self):
     self.assertEqual(abbreviate("Halley's Comet"), 'HC')
コード例 #13
0
ファイル: acronym_test.py プロジェクト: NSteinhoff/exercism
 def test_underscore_emphasis(self):
     self.assertEqual(abbreviate("The Road _Not_ Taken"), 'TRNT')
コード例 #14
0
ファイル: acronym_test.py プロジェクト: NSteinhoff/exercism
 def test_consecutive_delimiters(self):
     self.assertEqual(
         abbreviate('Something - I made up from thin air'), 'SIMUFTA')
コード例 #15
0
ファイル: acronym_test.py プロジェクト: NSteinhoff/exercism
 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")
コード例 #16
0
 def test_lowercase_words(self):
     assert abbreviate("Ruby on Rails") == "ROR"
コード例 #17
0
 def test_punctuation(self):
     self.assertEqual(abbreviate("First In, First Out"), "FIFO")
コード例 #18
0
 def test_hyphenated2(self):
     self.assertEqual('CMOSC', abbreviate('Complementary metal-oxide semi--conductor'))
コード例 #19
0
 def test_punctuation_without_whitespace(self):
     self.assertEqual(abbreviate("Complementary metal-oxide semiconductor"),
                      "CMOS")
コード例 #20
0
 def test_hyphenated3(self):
     self.assertEqual('ROR', abbreviate('rubyOn--Rails'))
コード例 #21
0
 def test_apostrophes(self):
     assert abbreviate("Halley's Comet") == "HC"
コード例 #22
0
ファイル: acronym_test.py プロジェクト: Audiodrome/exercism
 def test_punctuation_without_whitespace(self):
     self.assertEqual(
         abbreviate('Complementary metal-oxide semiconductor'), 'CMOS')
コード例 #23
0
ファイル: acronym_test.py プロジェクト: rootulp/exercism
 def test_lowercase_words(self):
     self.assertEqual('ROR', abbreviate('Ruby on Rails'))
コード例 #24
0
 def test_basic(self):
     self.assertEqual(abbreviate('Buenos Aires Ciudad'), 'BAC')
コード例 #25
0
ファイル: acronym_test.py プロジェクト: rootulp/exercism
 def test_punctuation(self):
     self.assertEqual('FIFO', abbreviate('First In, First Out'))
コード例 #26
0
 def test_lowercase_words(self):
     self.assertEqual(abbreviate("too long didn't read"), 'TLDR')
コード例 #27
0
ファイル: acronym_test.py プロジェクト: rootulp/exercism
 def test_hyphenated(self):
     self.assertEqual('CMOS',
                      abbreviate('Complementary metal-oxide semiconductor'))
コード例 #28
0
 def test_punctuation(self):
     self.assertEqual(abbreviate("O'Lord Almighty, the Only one."), 'OATOO')
コード例 #29
0
ファイル: acronym_test.py プロジェクト: Lordjiggyx/Excercism
 def test_lowercase_words(self):
     self.assertEqual(abbreviate('Ruby on Rails'), 'ROR')
コード例 #30
0
 def test_all_caps_words(self):
     self.assertEqual(abbreviate('WHAT YOU SEE IS WHAT YOU GET'), 'WYSIWYG')
コード例 #31
0
ファイル: acronym_test.py プロジェクト: Lordjiggyx/Excercism
 def test_all_caps_words(self):
     self.assertEqual(abbreviate('GNU Image Manipulation Program'), 'GIMP')
コード例 #32
0
 def test_punctuation_without_whitespace(self):
     self.assertEqual(abbreviate('document-object-model'), 'DOM')
コード例 #33
0
 def test_lowercase_words(self):
     self.assertEqual(abbreviate("Ruby on Rails"), "ROR")
コード例 #34
0
 def test_consecutive_delimiters(self):
     self.assertEqual(abbreviate("Something - I made up from thin air"),
                      "SIMUFTA")
コード例 #35
0
 def test_all_caps_word(self):
     self.assertEqual(abbreviate("GNU Image Manipulation Program"), "GIMP")
コード例 #36
0
 def test_underscore_emphasis(self):
     self.assertEqual(abbreviate("The Road _Not_ Taken"), "TRNT")
コード例 #37
0
 def test_very_long_abbreviation(self):
     self.assertEqual(abbreviate('Last Friday Night We Did it all again, Thank God its Friday'), 'LFNWDIAATGIF')
コード例 #38
0
 def test_underscore_emphasis(self):
     assert abbreviate("The Road _Not_ Taken") == "TRNT"
コード例 #39
0
 def test_apostrophes(self):
     self.assertEqual(abbreviate("Halley's Comet"), "HC")
コード例 #40
0
 def test_all_caps_words(self):
     self.assertEqual(abbreviate('PHP: Hypertext Preprocessor'), 'PHP')
コード例 #41
0
 def test_basic(self):
     self.assertEqual(abbreviate("Portable Network Graphics"), "PNG")
コード例 #42
0
ファイル: acronym_test.py プロジェクト: Oniwa/exercism.io
 def test_non_acronym_all_caps_word(self):
     self.assertEqual(abbreviate('GNU Image Manipulation Program'), 'GIMP')