forked from brianc/node-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinary-clause-tests.js
More file actions
30 lines (27 loc) · 1.06 KB
/
binary-clause-tests.js
File metadata and controls
30 lines (27 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* global test */
'use strict';
var assert = require('assert');
var Table = require(__dirname + '/../lib/table');
var Foo = Table.define({
name: 'foo',
columns: ['baz','bar']
});
test('operators', function() {
assert.equal(Foo.baz.equals(1).operator, '=');
assert.equal(Foo.baz.equal(1).operator, '=');
assert.equal(Foo.baz.notEqual(1).operator, '<>');
assert.equal(Foo.baz.notEquals(1).operator, '<>');
assert.equal(Foo.baz.like('asdf').operator, 'LIKE');
assert.equal(Foo.baz.notLike('asdf').operator, 'NOT LIKE');
assert.equal(Foo.baz.isNull().operator, 'IS NULL');
assert.equal(Foo.baz.isNotNull().operator, 'IS NOT NULL');
assert.equal(Foo.baz.gt(1).operator, '>');
assert.equal(Foo.baz.gte(1).operator, '>=');
assert.equal(Foo.baz.lt(1).operator, '<');
assert.equal(Foo.baz.lte(1).operator, '<=');
assert.equal(Foo.baz.add(1).operator, '+');
assert.equal(Foo.baz.subtract(1).operator, '-');
assert.equal(Foo.baz.multiply(1).operator, '*');
assert.equal(Foo.baz.divide(1).operator, '/');
assert.equal(Foo.baz.modulo(1).operator, '%');
});