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.
31 lines
641 B
31 lines
641 B
'use strict';
|
|
|
|
var assert = require('assert');
|
|
|
|
var Node = require(__dirname + '/../lib/node/');
|
|
|
|
var Bang = Node.define({
|
|
type: 'SELECT'
|
|
});
|
|
|
|
var Boom = Node.define({
|
|
constructor: function(n) {
|
|
Node.call(this);
|
|
this.name = n;
|
|
}
|
|
});
|
|
|
|
test('clause definition', function() {
|
|
var select = new Bang();
|
|
assert.equal(select.type, 'SELECT');
|
|
assert.equal(select.nodes.length, 0);
|
|
|
|
var q = new Boom('hai');
|
|
assert.equal(q.nodes.length, 0);
|
|
var q2 = new Boom('bai');
|
|
q.nodes.push(1);
|
|
assert.equal(q.nodes.length, 1);
|
|
assert.equal(q.name, 'hai');
|
|
assert.equal(q2.nodes.length, 0);
|
|
assert.equal(q2.name, 'bai');
|
|
});
|
|
|