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.

22 lines
529 B

  1. require "../../helper"
  2. require "./mal_spec_runner.cr"
  3. describe "'Make a Lisp' tests" do
  4. it "tests step2 of mal" do
  5. runner = MalTestRunner.new(__DIR__ + "/tests/step2_eval.mal")
  6. i = Crisp::Interpreter.new
  7. runner.each_test do |input, output, result|
  8. if result
  9. r = i.print i.eval_string(input)
  10. else
  11. output.empty?.should be_false
  12. begin
  13. i.eval_string(input)
  14. rescue e
  15. e.message.should match(/#{output.last.chomp}/)
  16. end
  17. end
  18. end
  19. end
  20. end