test_answers.txt 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. ====== test basic exec ======
  2. hello world!
  3. successfully errored with this message:
  4. Traceback (most recent call last):
  5. NameError: nonexistatn
  6. ====== test int methods ======
  7. 11
  8. 11
  9. 1
  10. ====== test float methods ======
  11. 11.125
  12. 11.125
  13. ====== test bool methods ======
  14. False
  15. 0
  16. ====== test string methods ======
  17. hello!
  18. hello!
  19. ====== test none methods ======
  20. None
  21. ====== test voidp methods ======
  22. <void* at 0x7b>
  23. 123
  24. ====== test sizing and indexing ======
  25. stack size 6
  26. ====== test error catching ======
  27. successfully errored with this message:
  28. File "main.py", line 1
  29. let's make sure syntax errors get caught
  30. SyntaxError: EOL while scanning string literal
  31. ====== test simple call ======
  32. x : -1
  33. ====== test vararg call ======
  34. vararg_x : 21
  35. ====== test keyword call ======
  36. keyword_x : 4
  37. keyword_x : 2
  38. ====== test return many ======
  39. retmany_x : 1
  40. retmany_x : 2
  41. retmany_x : 3
  42. successfully errored with this message:
  43. TypeError: expected 2 positional arguments, got 0 (x)
  44. ['hello']
  45. ====== test bindings ======
  46. 12
  47. ====== test bindings 2 ======
  48. 2
  49. 5
  50. 4
  51. 3
  52. 2
  53. 1
  54. ====== test bindings fib ======
  55. 55
  56. ====== test error propagate ======
  57. successfully errored with this message:
  58. Traceback (most recent call last):
  59. File "main.py", line 1
  60. test_error_propagate()
  61. NameError: catch me
  62. ====== test other errors ======
  63. successfully errored with this message:
  64. Traceback (most recent call last):
  65. NameError: nonexistant
  66. successfully errored with this message:
  67. Traceback (most recent call last):
  68. File "main.py", line 1
  69. raise NameError('testing error throwing from python')
  70. NameError: testing error throwing from python
  71. ====== test TypeError ======
  72. successfully errored with this message:
  73. TypeError: expected 'int', got 'float'
  74. ====== test complicated errors ======
  75. Traceback (most recent call last):
  76. File "main.py", line 1
  77. test_error_propagate()
  78. NameError: catch me
  79. successfully errored with this message:
  80. Traceback (most recent call last):
  81. _: test direct error mechanism
  82. successfully errored with this message:
  83. Traceback (most recent call last):
  84. File "main.py", line 1
  85. test_nested_error()
  86. File "main.py", line 1, in error_from_python
  87. def error_from_python() : raise NotImplementedError()
  88. NotImplementedError
  89. ====== test getattr/setattr ======
  90. pi: 3.14
  91. 2
  92. ====== test eval ======
  93. pi: 2.00
  94. ====== test py_repr ======
  95. ['1', 2, (3, '4')]