home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Lib / test / test_strop.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2000-06-23  |  3.9 KB  |  91 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. verbose
  5. test('atoi', ' 1 ', 1)
  6. test('atoi', ' 1x', ValueError)
  7. test('atoi', ' x1 ', ValueError)
  8. test('atol', '  1  ', 0x1L)
  9. test('atol', '  1x ', ValueError)
  10. test('atol', '  x1 ', ValueError)
  11. test('atof', '  1  ', 1.0)
  12. test('atof', '  1x ', ValueError)
  13. test('atof', '  x1 ', ValueError)
  14. test('capitalize', ' hello ', ' hello ')
  15. test('capitalize', 'hello ', 'Hello ')
  16. test('find', 'abcdefghiabc', 0, 'abc')
  17. test('find', 'abcdefghiabc', 9, 'abc', 1)
  18. test('find', 'abcdefghiabc', -1, 'def', 4)
  19. test('rfind', 'abcdefghiabc', 9, 'abc')
  20. test('lower', 'HeLLo', 'hello')
  21. test('upper', 'HeLLo', 'HELLO')
  22. test('maketrans', 'abc', transtable, 'xyz')
  23. test('maketrans', 'abc', ValueError, 'xyzq')
  24. test('split', 'this is the split function', [
  25.     'this',
  26.     'is',
  27.     'the',
  28.     'split',
  29.     'function'])
  30. test('split', 'a|b|c|d', [
  31.     'a',
  32.     'b',
  33.     'c',
  34.     'd'], '|')
  35. test('split', 'a|b|c|d', [
  36.     'a',
  37.     'b',
  38.     'c|d'], '|', 2)
  39. test('split', 'a b c d', [
  40.     'a',
  41.     'b c d'], None, 1)
  42. test('split', 'a b c d', [
  43.     'a',
  44.     'b',
  45.     'c d'], None, 2)
  46. test('split', 'a b c d', [
  47.     'a',
  48.     'b',
  49.     'c',
  50.     'd'], None, 3)
  51. test('split', 'a b c d', [
  52.     'a',
  53.     'b',
  54.     'c',
  55.     'd'], None, 4)
  56. test('split', 'a b c d', [
  57.     'a',
  58.     'b',
  59.     'c',
  60.     'd'], None, 0)
  61. test('split', 'a  b  c  d', [
  62.     'a',
  63.     'b',
  64.     'c  d'], None, 2)
  65. test('join', [
  66.     'a',
  67.     'b',
  68.     'c',
  69.     'd'], 'a b c d')
  70. test('join', ('a', 'b', 'c', 'd'), 'abcd', '')
  71. test('join', Sequence(), 'w x y z')
  72. print strop.join([
  73.     'x' * 100] * 100, ':')
  74. print strop.join(('x' * 100,) * 100, ':')
  75. test('strip', '   hello   ', 'hello')
  76. test('lstrip', '   hello   ', 'hello   ')
  77. test('rstrip', '   hello   ', '   hello')
  78. test('swapcase', 'HeLLo cOmpUteRs', 'hEllO CoMPuTErS')
  79. test('translate', 'xyzabcdef', 'xyzxyz', transtable, 'def')
  80. test('replace', 'one!two!three!', 'one@two!three!', '!', '@', 1)
  81. test('replace', 'one!two!three!', 'one@two@three!', '!', '@', 2)
  82. test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 3)
  83. test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 4)
  84. test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 0)
  85. test('replace', 'one!two!three!', 'one@two@three@', '!', '@')
  86. test('replace', 'one!two!three!', 'one!two!three!', 'x', '@')
  87. test('replace', 'one!two!three!', 'one!two!three!', 'x', '@', 2)
  88. strop.whitespace
  89. strop.lowercase
  90. strop.uppercase
  91.