Skip to content

Commit

Permalink
test chars in records names
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoy-googly-moogly committed Nov 29, 2024
1 parent b5312ae commit 61a7e03
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test/src/databases/all/compound-atomic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ describe.each(runtimes.runtimeList)(
});
test.when(supportsNestedArrays)('each.each array of array', async () => {
await expect(`
run: ${empty} extend { dimension: aoa is [[1,2]] }
-> { select: aoa.each.each }
run: ${empty} extend { dimension: aoa is [[1,2]] } -> { select: aoa.each.each }
`).malloyResultMatches(runtime, [{each: 1}, {each: 2}]);
});
});
Expand All @@ -211,6 +210,22 @@ describe.each(runtimes.runtimeList)(
-> { select: ${malloySizes}}
`).malloyResultMatches(runtime, rec_eq());
});
test('special character in record property name', async () => {
const special_chars = ["'", '"', '.', '`'];
for (const c of special_chars) {
const qname = '_\\' + c + '_';
const name = '_' + c + '_';
const malloySrc = `run: ${empty} -> { select: \`${qname}\` is 'ok' }`;
// no malloyResultMatches because it treats a special in an expect key
const query = runtime.loadQuery(malloySrc);
const result = await query.run();
const p =
result.data.path(0, name).value === 'ok'
? 'ok'
: `Name containing the ${c} character was not ok`;
expect(p).toEqual('ok');
}
});
test.when(canReadCompoundSchema)(
'can read schema of record object',
async () => {
Expand Down

0 comments on commit 61a7e03

Please sign in to comment.