123456789101112131415161718192021222324252627282930 |
- const test = require('tape')
- const helpers = require('./helpers')
-
- test('compiles numbers', t => {
- t.plan(1)
-
- const result = helpers.compile('5')
- t.equal(result, '5')
- })
-
- test('compiles strings', t => {
- t.plan(1)
-
- const result = helpers.compile('"hello world"')
- t.equal(result, 'hello world')
- })
-
- test('compiles lambdas', t => {
- t.plan(1)
-
- const result = helpers.compile('(lambda (x) (* x x))')
- t.equal(result, '<lambda>')
- })
-
- test('compiles applications that evaluate to numbers', t => {
- t.plan(1)
-
- const result = helpers.compile('((lambda (x) (+ x 1)) 5)')
- t.equal(result, '6')
- })
|