aboutsummaryrefslogtreecommitdiff
path: root/challenge-131/tyler-wardhaugh/python/test_ch2.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-131/tyler-wardhaugh/python/test_ch2.py')
-rwxr-xr-xchallenge-131/tyler-wardhaugh/python/test_ch2.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/challenge-131/tyler-wardhaugh/python/test_ch2.py b/challenge-131/tyler-wardhaugh/python/test_ch2.py
new file mode 100755
index 0000000000..707951e3e4
--- /dev/null
+++ b/challenge-131/tyler-wardhaugh/python/test_ch2.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+"""Test Task 2"""
+
+import unittest
+from ch2 import find_pairs
+
+
+class TestTask2(unittest.TestCase):
+ """Test Task 2"""
+
+ def test_example_cases(self):
+ """Test Task 2"""
+ self.assertEqual(('"(["', '")]"'),
+ find_pairs('""[]()', '"I like (parens) and the Apple ][+" they said.'))
+ self.assertEqual(("/**/<", "/**/>"),
+ find_pairs("**//<>", "/* This is a comment (in some languages) */ <could be a tag>"))
+
+
+if __name__ == '__main__':
+ unittest.main()