You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
798 B

  1. #!/usr/bin/env python
  2. from __future__ import print_function
  3. from example import VectorInt, El, VectorEl, VectorVectorEl, VectorBool
  4. v_int = VectorInt([0, 0])
  5. print(len(v_int))
  6. print(bool(v_int))
  7. v_int2 = VectorInt([0, 0])
  8. print(v_int == v_int2)
  9. v_int2[1] = 1
  10. print(v_int != v_int2)
  11. v_int2.append(2)
  12. v_int2.append(3)
  13. v_int2.insert(0, 1)
  14. v_int2.insert(0, 2)
  15. v_int2.insert(0, 3)
  16. print(v_int2)
  17. v_int.append(99)
  18. v_int2[2:-2] = v_int
  19. print(v_int2)
  20. del v_int2[1:3]
  21. print(v_int2)
  22. del v_int2[0]
  23. print(v_int2)
  24. v_a = VectorEl()
  25. v_a.append(El(1))
  26. v_a.append(El(2))
  27. print(v_a)
  28. vv_a = VectorVectorEl()
  29. vv_a.append(v_a)
  30. vv_b = vv_a[0]
  31. print(vv_b)
  32. vv_c = VectorBool()
  33. for i in range(10):
  34. vv_c.append(i % 2 == 0)
  35. for i in range(10):
  36. if vv_c[i] != (i % 2 == 0):
  37. print("Error!")
  38. print(vv_c)