From fe00ecfb7362652b3d450000cd099f4044775cfd Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sun, 17 Nov 2024 20:40:19 +1100 Subject: sgreen solutions to challenge 295 --- challenge-295/sgreen/python/test.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 challenge-295/sgreen/python/test.py (limited to 'challenge-295/sgreen/python/test.py') 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() -- cgit