Formula.cpp.praat 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # File sys/Formula.cpp.praat
  2. # Generated by test/createPraatTests.praat
  3. # Thu Sep 13 16:51:30 2018
  4. #
  5. # result = x + y
  6. #
  7. x = 5
  8. y = 6
  9. result = x + y
  10. assert result = 11
  11. #
  12. # result# = x + owned y#
  13. #
  14. result# = 5 + { 11, 13, 31 } ; numeric vector literals are owned
  15. assert result# = { 16, 18, 36 }
  16. #
  17. # result# = x + unowned y#
  18. #
  19. y# = { 17, -11, 29 }
  20. result# = 30 + y# ; numeric vector variables are not owned
  21. assert result# = { 47, 19, 59 }
  22. #
  23. # Error: unequal sizes.
  24. #
  25. x# = { 11, 13, 17 }
  26. y# = { 8, 90 }
  27. asserterror When adding vectors, their numbers of elements should be equal, instead of 3 and 2.
  28. result# = x# + y#
  29. #
  30. # result# = owned x# + y#
  31. #
  32. result# = { 11, 13, 17 } + { 44, 56, 67 } ; owned + owned
  33. assert result# = { 55, 69, 84 }
  34. y# = { 3, 2, 89.5 }
  35. result# = { 11, 13, 17 } + y# ; owned + unowned
  36. assert result# = { 14, 15, 106.5 }
  37. #
  38. # result# = unowned x# + owned y#
  39. #
  40. x# = { 14, -3, 6.25 }
  41. result# = x# + { 55, 1, -89 }
  42. assert result# = { 69, -2, -82.75 }
  43. #
  44. # result# = unowned x# + unowned y#
  45. #
  46. x# = { 14, -33, 6.25 }
  47. y# = { -33, 17, 9 }
  48. result# = x# + y#
  49. assert result# = { -19, -16, 15.25 }
  50. appendInfoLine: "sys/Formula.cpp.praat", " OK"