Esempio n. 1
0
 def testEscapeFromIndex(self):
   """Test the escapeDoubleDash function with a start index."""
   # No escaping should occur if we start at the second element.
   args = [r"--", r"foo"]
   escaped = escapeDoubleDash(args, 1)
   self.assertEqual(list(escaped), [r"--", r"foo"])
Esempio n. 2
0
 def testEscapeAndUnescape(self):
   """Verify that escaping and unescaping an argument vector results in the original."""
   args = [r"bar", r"\\--", r"\--", r"--", r"--fo", r"foo"]
   transformed = unescapeDoubleDash(escapeDoubleDash(args))
   self.assertEqual(list(transformed), args)
Esempio n. 3
0
 def testEscape(self):
   """Test the escapeDoubleDash function."""
   escaped = escapeDoubleDash([r"--"])
   self.assertEqual(list(escaped), [r"\--"])