diff options
| author | Mohammad Sajid Anwar <Mohammad.Anwar@yahoo.com> | 2024-11-17 16:36:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-17 16:36:08 +0000 |
| commit | 7309ac414326e436ee729a71db0a1cb127041ead (patch) | |
| tree | 2b7fa45a2ff970bc91249bb6b2783c6dc38a3e4e /challenge-295/sgreen/python/test.py | |
| parent | 889332989f865e782e6727abc8a85107b2439946 (diff) | |
| parent | fe00ecfb7362652b3d450000cd099f4044775cfd (diff) | |
| download | perlweeklychallenge-club-7309ac414326e436ee729a71db0a1cb127041ead.tar.gz perlweeklychallenge-club-7309ac414326e436ee729a71db0a1cb127041ead.tar.bz2 perlweeklychallenge-club-7309ac414326e436ee729a71db0a1cb127041ead.zip | |
Merge pull request #11167 from simongreen-net/master
sgreen solutions to challenge 295
Diffstat (limited to 'challenge-295/sgreen/python/test.py')
| -rwxr-xr-x | challenge-295/sgreen/python/test.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/challenge-295/sgreen/python/test.py b/challenge-295/sgreen/python/test.py new file mode 100755 index 0000000000..33117a6d85 --- /dev/null +++ b/challenge-295/sgreen/python/test.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import unittest +ch_1 = __import__('ch-1') +ch_2 = __import__('ch-2') + + +class TestClass(unittest.TestCase): + def test_ch_1(self): + self.assertTrue(ch_1.word_break( + 'weeklychallenge', ["challenge", "weekly"])) + self.assertTrue(ch_1.word_break('perlrakuperl', ["raku", "perl"])) + self.assertFalse(ch_1.word_break( + 'sonsanddaughters', ["sons", "sand", "daughters"])) + + def test_ch_2(self): + self.assertEqual(ch_2.jump_game([2, 3, 1, 1, 4]), 2) + self.assertEqual(ch_2.jump_game([2, 3, 0, 4]), 2) + self.assertEqual(ch_2.jump_game([2, 0, 0, 4]), None) + + +if __name__ == '__main__': + unittest.main() |
