-
Notifications
You must be signed in to change notification settings - Fork 191
Expand file tree
/
Copy pathregex-tests.js
More file actions
40 lines (35 loc) · 1.08 KB
/
regex-tests.js
File metadata and controls
40 lines (35 loc) · 1.08 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
31
32
33
34
35
36
37
38
39
40
'use strict';
var Harness = require('./support');
var customer = Harness.defineCustomerTable();
Harness.test({
query: customer.select(customer.metadata.regex('age')),
pg: {
text : 'SELECT ("customer"."metadata" ~ $1) FROM "customer"',
string: 'SELECT ("customer"."metadata" ~ \'age\') FROM "customer"'
},
params: ['age']
});
Harness.test({
query: customer.select(customer.metadata.iregex('age')),
pg: {
text : 'SELECT ("customer"."metadata" ~* $1) FROM "customer"',
string: 'SELECT ("customer"."metadata" ~* \'age\') FROM "customer"'
},
params: ['age']
});
Harness.test({
query: customer.select(customer.metadata.notRegex('age')),
pg: {
text : 'SELECT ("customer"."metadata" !~ $1) FROM "customer"',
string: 'SELECT ("customer"."metadata" !~ \'age\') FROM "customer"'
},
params: ['age']
});
Harness.test({
query: customer.select(customer.metadata.notIregex('age')),
pg: {
text : 'SELECT ("customer"."metadata" !~* $1) FROM "customer"',
string: 'SELECT ("customer"."metadata" !~* \'age\') FROM "customer"'
},
params: ['age']
});