@malloydata/malloy-tests 0.0.250-dev250327174212 → 0.0.250
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@jest/globals": "^29.4.3",
|
|
24
|
-
"@malloydata/db-bigquery": "^0.0.250
|
|
25
|
-
"@malloydata/db-duckdb": "^0.0.250
|
|
26
|
-
"@malloydata/db-postgres": "^0.0.250
|
|
27
|
-
"@malloydata/db-snowflake": "^0.0.250
|
|
28
|
-
"@malloydata/db-trino": "^0.0.250
|
|
29
|
-
"@malloydata/malloy": "^0.0.250
|
|
30
|
-
"@malloydata/malloy-tag": "^0.0.250
|
|
31
|
-
"@malloydata/render": "^0.0.250
|
|
24
|
+
"@malloydata/db-bigquery": "^0.0.250",
|
|
25
|
+
"@malloydata/db-duckdb": "^0.0.250",
|
|
26
|
+
"@malloydata/db-postgres": "^0.0.250",
|
|
27
|
+
"@malloydata/db-snowflake": "^0.0.250",
|
|
28
|
+
"@malloydata/db-trino": "^0.0.250",
|
|
29
|
+
"@malloydata/malloy": "^0.0.250",
|
|
30
|
+
"@malloydata/malloy-tag": "^0.0.250",
|
|
31
|
+
"@malloydata/render": "^0.0.250",
|
|
32
32
|
"events": "^3.3.0",
|
|
33
33
|
"jsdom": "^22.1.0",
|
|
34
34
|
"luxon": "^2.4.0",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"@types/jsdom": "^21.1.1",
|
|
39
39
|
"@types/luxon": "^2.4.0"
|
|
40
40
|
},
|
|
41
|
-
"version": "0.0.250
|
|
41
|
+
"version": "0.0.250"
|
|
42
42
|
}
|
|
@@ -439,6 +439,13 @@ describe.each(runtimes.runtimeList)('filter expressions %s', (dbName, db) => {
|
|
|
439
439
|
-> {select: t,n; order_by: n}`;
|
|
440
440
|
return db.loadModel(rangeModel);
|
|
441
441
|
}
|
|
442
|
+
function mkEqTime(exact: string) {
|
|
443
|
+
return db.loadModel(
|
|
444
|
+
`query: eqtime is ${dbName}.sql("""
|
|
445
|
+
SELECT ${lit(exact, 'timestamp')} AS ${q`t`}, 'exact' as ${q`n`}
|
|
446
|
+
""") -> {select: t, n}`
|
|
447
|
+
);
|
|
448
|
+
}
|
|
442
449
|
|
|
443
450
|
/**
|
|
444
451
|
* All the relative time tests need a way to set what time it is now
|
|
@@ -634,6 +641,18 @@ describe.each(runtimes.runtimeList)('filter expressions %s', (dbName, db) => {
|
|
|
634
641
|
run: range + { where: t ~ f'2023-01-01-WK' }
|
|
635
642
|
`).malloyResultMatches(range, inRange);
|
|
636
643
|
});
|
|
644
|
+
test('full second literal', async () => {
|
|
645
|
+
const eqtime = mkEqTime('2023-01-01 01:02:03');
|
|
646
|
+
await expect(`
|
|
647
|
+
run: eqtime + { where: t ~ f'2023-01-01 01:02:03' }
|
|
648
|
+
`).malloyResultMatches(eqtime, [{n: 'exact'}]);
|
|
649
|
+
});
|
|
650
|
+
test('subsecond literal', async () => {
|
|
651
|
+
const eqtime = mkEqTime('2023-01-01 01:02:03.04');
|
|
652
|
+
await expect(`
|
|
653
|
+
run: eqtime + { where: t ~ f'2023-01-01 01:02:03.04' }
|
|
654
|
+
`).malloyResultMatches(eqtime, [{n: 'exact'}]);
|
|
655
|
+
});
|
|
637
656
|
test('today', async () => {
|
|
638
657
|
nowIs('2001-02-03 12:00:00');
|
|
639
658
|
const range = mkRange('2001-02-03 00:00:00', '2001-02-04 00:00:00');
|