Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/pexpect/tests/test_command_list_split.py

Issue 1398903002: Add third_party/pexpect (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@end-to-end-test
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/pexpect/tests/test_async.py ('k') | third_party/pexpect/tests/test_constructor.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 '''
3 PEXPECT LICENSE
4
5 This license is approved by the OSI and FSF as GPL-compatible.
6 http://opensource.org/licenses/isc-license.txt
7
8 Copyright (c) 2012, Noah Spurrier <noah@noah.org>
9 PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
10 PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE
11 COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES.
12 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19
20 '''
21 import pexpect
22 import unittest
23 from . import PexpectTestCase
24
25 class SplitCommandLineTestCase(PexpectTestCase.PexpectTestCase):
26 def testSplitSizes(self):
27 assert len(pexpect.split_command_line(r'')) == 0
28 assert len(pexpect.split_command_line(r'one')) == 1
29 assert len(pexpect.split_command_line(r'one two')) == 2
30 assert len(pexpect.split_command_line(r'one two')) == 2
31 assert len(pexpect.split_command_line(r'one two')) == 2
32 assert len(pexpect.split_command_line(r'one\ one')) == 1
33 assert len(pexpect.split_command_line('\'one one\'')) == 1
34 assert len(pexpect.split_command_line(r'one\"one')) == 1
35 assert len(pexpect.split_command_line(r'This\' is a\'\ test')) == 3
36
37 if __name__ == '__main__':
38 unittest.main()
39
40 suite = unittest.makeSuite(SplitCommandLineTestCase,'test')
OLDNEW
« no previous file with comments | « third_party/pexpect/tests/test_async.py ('k') | third_party/pexpect/tests/test_constructor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698