PageRenderTime 36ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/python/li_cstring_runme.py

#
Python | 32 lines | 21 code | 11 blank | 0 comment | 9 complexity | 66b24cc4aed064308302919cff08e361 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. from li_cstring import *
  2. if count("ab\0ab\0ab\0", 0) != 3:
  3. raise RuntimeError
  4. if test1() != "Hello World":
  5. raise RuntimeError
  6. if test2() != " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_":
  7. raise RuntimeError
  8. if test3("hello") != "hello-suffix":
  9. print test3("hello")
  10. raise RuntimeError
  11. if test4("hello") != "hello-suffix":
  12. print test4("hello")
  13. raise RuntimeError
  14. if test5(4) != 'xxxx':
  15. raise RuntimeError
  16. if test6(10) != 'xxxxx':
  17. raise RuntimeError
  18. if test7() !="Hello world!":
  19. raise RuntimeError
  20. if test8() != " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_":
  21. raise RuntimeError