- print parse_command('hello world')
- print parse_command('hello planet=earth')
- print parse_command('hello planet="third rock from the sun"')
- print parse_command(u' planet="third rock from the sun" hello ')
- print parse_command(u' planet="third rock from the sun" "hi, hello"'
- '"how are you" ')
- print parse_command(u'one two three "fourth number"=four')
- print parse_command(u'one two three "fourth number=four"')
- print parse_command(u'one two three fourth\=four')
- print parse_command(u'one two three fourth=four=five')
- print parse_command(ur'nice\nlong\n\ttext')
- print parse_command('=hello')
+ p = parse_command('hello world')
+ assert p == ([u'hello', u'world'], {}), p
+ p = parse_command('hello planet=earth')
+ assert p == ([u'hello'], {'planet': u'earth'}), p
+ p = parse_command('hello planet="third rock from the sun"')
+ assert p == ([u'hello'], {'planet': u'third rock from the sun'}), p
+ p = parse_command(u' planet="third rock from the sun" hello ')
+ assert p == ([u'hello'], {'planet': u'third rock from the sun'}), p
+ p = parse_command(u' planet="third rock from the sun" "hi, hello" '
+ '"how are you" ')
+ assert p == ([u'hi, hello', u'how are you'],
+ {'planet': u'third rock from the sun'}), p
+ p = parse_command(u'one two three "fourth number"=four')
+ assert p == ([u'one', u'two', u'three'], {'fourth number': u'four'}), p
+ p = parse_command(u'one two three "fourth number=four"')
+ assert p == ([u'one', u'two', u'three', u'fourth number=four'], {}), p
+ p = parse_command(u'one two three fourth\=four')
+ assert p == ([u'one', u'two', u'three', u'fourth=four'], {}), p
+ p = parse_command(u'one two three fourth=four=five')
+ assert p == ([u'one', u'two', u'three'], {'fourth': u'four=five'}), p
+ p = parse_command(ur'nice\nlong\n\ttext')
+ assert p == ([u'nice\nlong\n\ttext'], {}), p
+ p = parse_command('=hello')
+ assert p == ([u'=hello'], {}), p
+ p = parse_command(r'\thello')
+ assert p == ([u'\thello'], {}), p
+ p = parse_command(r'\N')
+ assert p == ([None], {}), p
+ p = parse_command(r'none=\N')
+ assert p == ([], {'none': None}), p
+ p = parse_command(r'\N=none')
+ assert p == ([], {'\\N': 'none'}), p
+ p = parse_command(r'Not\N')
+ assert p == ([u'Not\\N'], {}), p
+ p = parse_command(r'\None')
+ assert p == ([u'\\None'], {}), p