@malloydata/malloy-tests 0.0.197 → 0.0.198-dev241010181909
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,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@jest/globals": "^29.4.3",
|
|
24
|
-
"@malloydata/db-bigquery": "^0.0.
|
|
25
|
-
"@malloydata/db-duckdb": "^0.0.
|
|
26
|
-
"@malloydata/db-postgres": "^0.0.
|
|
27
|
-
"@malloydata/db-snowflake": "^0.0.
|
|
28
|
-
"@malloydata/db-trino": "^0.0.
|
|
29
|
-
"@malloydata/malloy": "^0.0.
|
|
30
|
-
"@malloydata/render": "^0.0.
|
|
24
|
+
"@malloydata/db-bigquery": "^0.0.198-dev241010181909",
|
|
25
|
+
"@malloydata/db-duckdb": "^0.0.198-dev241010181909",
|
|
26
|
+
"@malloydata/db-postgres": "^0.0.198-dev241010181909",
|
|
27
|
+
"@malloydata/db-snowflake": "^0.0.198-dev241010181909",
|
|
28
|
+
"@malloydata/db-trino": "^0.0.198-dev241010181909",
|
|
29
|
+
"@malloydata/malloy": "^0.0.198-dev241010181909",
|
|
30
|
+
"@malloydata/render": "^0.0.198-dev241010181909",
|
|
31
31
|
"events": "^3.3.0",
|
|
32
32
|
"jsdom": "^22.1.0",
|
|
33
33
|
"luxon": "^2.4.0",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"@types/jsdom": "^21.1.1",
|
|
38
38
|
"@types/luxon": "^2.4.0"
|
|
39
39
|
},
|
|
40
|
-
"version": "0.0.
|
|
40
|
+
"version": "0.0.198-dev241010181909"
|
|
41
41
|
}
|
|
@@ -410,6 +410,23 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
|
|
|
410
410
|
`).malloyResultMatches(expressionModel, {a: 312});
|
|
411
411
|
});
|
|
412
412
|
|
|
413
|
+
it('case expressions', async () => {
|
|
414
|
+
await expect(`
|
|
415
|
+
run: aircraft_models -> {
|
|
416
|
+
where: manufacturer ? 'BOEING' | 'CESSNA'
|
|
417
|
+
group_by:
|
|
418
|
+
other is case when manufacturer = 'BOEING' then 'BOEING' else 'OTHER' end
|
|
419
|
+
group_by:
|
|
420
|
+
nully is case when manufacturer = 'BOEING' then 'BOEING' end
|
|
421
|
+
group_by:
|
|
422
|
+
valuey is case manufacturer when 'BOEING' then 'BOEING' else 'NOT BOEING' end
|
|
423
|
+
}
|
|
424
|
+
`).malloyResultMatches(expressionModel, [
|
|
425
|
+
{other: 'BOEING', nully: 'BOEING', valuey: 'BOEING'},
|
|
426
|
+
{other: 'OTHER', nully: null, valuey: 'NOT BOEING'},
|
|
427
|
+
]);
|
|
428
|
+
});
|
|
429
|
+
|
|
413
430
|
it('sql safe cast', async () => {
|
|
414
431
|
const safeCast = `
|
|
415
432
|
run: ${databaseName}.sql('SELECT 1 as one') -> { select:
|