A fork of Crisp for HARP
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.

72 lines
1.1 KiB

  1. ;;; TODO: really a step5 test
  2. ;;
  3. ;; Testing that (do (do)) not broken by TCO
  4. (do (do 1 2))
  5. ;=>2
  6. ;;
  7. ;; Testing read-string, eval and slurp
  8. (read-string "(1 2 (3 4) nil)")
  9. ;=>(1 2 (3 4) nil)
  10. (read-string "(+ 2 3)")
  11. ;=>(+ 2 3)
  12. (read-string "7 ;; comment")
  13. ;=>7
  14. ;;; Differing output, but make sure no fatal error
  15. (read-string ";; comment")
  16. (eval (read-string "(+ 2 3)"))
  17. ;=>5
  18. ;;; TODO: fix newline matching so that this works
  19. ;;;(slurp "../tests/test.txt")
  20. ;;;;=>"A line of text\n"
  21. ;; Testing load-file
  22. (load-file "../tests/inc.mal")
  23. (inc1 7)
  24. ;=>8
  25. (inc2 7)
  26. ;=>9
  27. (inc3 9)
  28. ;=>12
  29. ;;
  30. ;; Testing that *ARGV* exists and is an empty list
  31. (list? *ARGV*)
  32. ;=>true
  33. *ARGV*
  34. ;=>()
  35. ;;
  36. ;; -------- Optional Functionality --------
  37. ;; Testing comments in a file
  38. (load-file "../tests/incB.mal")
  39. ; "incB.mal finished"
  40. ;=>"incB.mal return string"
  41. (inc4 7)
  42. ;=>11
  43. (inc5 7)
  44. ;=>12
  45. ;; Testing map literal across multiple lines in a file
  46. (load-file "../tests/incC.mal")
  47. mymap
  48. ;=>{"a" 1}
  49. ;;; TODO: really a step5 test
  50. ;; Testing that vector params not broken by TCO
  51. (def! g (fn* [] 78))
  52. (g)
  53. ;=>78
  54. (def! g (fn* [a] (+ a 78)))
  55. (g 3)
  56. ;=>81