Skip to content

Commit 47011c2

Browse files
committed
test: Include IPC file format tests.
1 parent 3fda6d4 commit 47011c2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/table-to-ipc-test.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ describe('tableToIPC', () => {
1414
for (const [name, method] of Object.entries(dataMethods)) {
1515
it(`encodes ${name} data`, async () => {
1616
const data = await method();
17-
data.forEach(({ bytes }) => testEncode(bytes));
17+
data.forEach(({ bytes }) => testEncode(bytes, 'stream'));
18+
data.forEach(({ bytes }) => testEncode(bytes, 'file'));
1819
});
1920
}
2021

2122
for (const file of files) {
2223
it(`encodes ${file}`, async () => {
2324
const bytes = new Uint8Array(await readFile(`test/data/${file}`));
24-
testEncode(bytes);
25+
testEncode(bytes, 'stream');
26+
testEncode(bytes, 'file');
2527
});
2628
}
2729

@@ -33,7 +35,7 @@ describe('tableToIPC', () => {
3335
});
3436
});
3537

36-
function testEncode(bytes) {
38+
function testEncode(bytes, format = 'stream') {
3739
// load table
3840
const table = tableFromIPC(bytes);
3941

@@ -46,9 +48,9 @@ function testEncode(bytes) {
4648
};
4749

4850
// encode table to ipc bytes
49-
const ipc = tableToIPC(table);
51+
const ipc = tableToIPC(table, { format });
5052

51-
// parse ipc byte to get a "round-trip" table
53+
// parse ipc bytes to get a "round-trip" table
5254
const round = tableFromIPC(ipc);
5355

5456
// check schema and shape equality

0 commit comments

Comments
 (0)