Chervil is a toy Lisp interpreter written in Ruby
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.

application_spec.rb 309B

1234567891011121314
  1. module Chervil
  2. RSpec.describe AST::Definition do
  3. it 'evaluates addition' do
  4. env = Env.new
  5. expect(
  6. AST::Application.new(
  7. AST::Identifier.new('+'),
  8. [AST::Number.new(1.0), AST::Number.new(2.0)]
  9. )
  10. .evaluate(env)
  11. ).to eq(3.0)
  12. end
  13. end
  14. end