def test_backslash_char(self): self.assertEqual(ipa.tokenize('r\\'), ['r\\']) self.assertEqual(ipa.tokenize('B\\'), ['B\\']) self.assertEqual(ipa.tokenize('3\\'), ['3\\']) self.assertEqual(ipa.tokenize('@\\'), ['@\\']) self.assertEqual(ipa.tokenize('<\\'), ['<\\']) self.assertEqual(ipa.tokenize('>\\'), ['>\\']) self.assertEqual(ipa.tokenize('=\\'), ['=\\']) self.assertEqual(ipa.tokenize('_\\'), ['_\\'])
def test_long_string(self): actual = ipa.tokenize('r\\bcde_\\_tgmr\\') expected = ['r\\', 'b', 'c', 'd', 'e', '_\\', '_', 't', 'g', 'm', 'r\\'] self.assertEqual(actual, expected)
def test_slash_at_beginning_errors(self): with self.assertRaises(Exception): ipa.tokenize('\\') with self.assertRaises(Exception): ipa.tokenize('\\abcdef')
def test_simple_chars(self): actual = ipa.tokenize('abc9de0f@T6GMTqR') expected = ['a', 'b', 'c', '9', 'd', 'e', '0', 'f', '@', 'T', '6', 'G', 'M', 'T', 'q', 'R'] self.assertEqual(actual, expected)
def test_simple_char(self): self.assertEqual(ipa.tokenize('a'), ['a']) self.assertEqual(ipa.tokenize('T'), ['T']) self.assertEqual(ipa.tokenize('6'), ['6']) self.assertEqual(ipa.tokenize('@'), ['@'])