Skip to content

Commit

Permalink
Additional test, parse tuple with two atoms
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlopez committed Jan 15, 2019
1 parent 50d6c91 commit 2556a26
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/parsers.js
Expand Up @@ -179,8 +179,8 @@ exports['parse empty tuple expression'] = function (test) {
test.ok(tuples.isTuple(result.evaluate(context)));
};

exports['parse empty tuple expression'] = function (test) {
var parser = parsers.parser("{}");
exports['parse tuple expression'] = function (test) {
var parser = parsers.parser("{ foo, bar }");
var context = contexts.context();

var result = parser.parse();
Expand All @@ -191,7 +191,13 @@ exports['parse empty tuple expression'] = function (test) {

test.ok(tuple);
test.ok(tuples.isTuple(tuple));
test.equal(tuple.size(), 0);
test.equal(tuple.size(), 2);

test.ok(atoms.isAtom(tuple.element(0)));
test.ok(atoms.isAtom(tuple.element(1)));

test.equal(tuple.element(0).name(), 'foo');
test.equal(tuple.element(1).name(), 'bar');
};

exports['parse empty list expression'] = function (test) {
Expand Down

0 comments on commit 2556a26

Please sign in to comment.