Skip to content

Commit f9ae0be

Browse files
committed
enable decimal test
1 parent dae7848 commit f9ae0be

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

Diff for: tests/ffi.test.ts

+19-21
Original file line numberDiff line numberDiff line change
@@ -368,32 +368,30 @@ describe("extension array", (t) => {
368368
});
369369
});
370370

371-
// This looks to be parsing wrong somewhere
372-
test.skip("decimal128", (t) => {
373-
let columnIndex = TEST_TABLE.schema.fields.findIndex(
374-
(field) => field.name == "decimal128"
375-
);
371+
describe("decimal128", (t) => {
372+
it("", () => {
373+
let columnIndex = TEST_TABLE.schema.fields.findIndex(
374+
(field) => field.name == "decimal128"
375+
);
376376

377-
const originalField = TEST_TABLE.schema.fields[columnIndex];
378-
// declare it's not null
379-
const originalVector = TEST_TABLE.getChildAt(columnIndex) as arrow.Vector;
380-
const fieldPtr = FFI_TABLE.schemaAddr(columnIndex);
381-
const field = parseField(WASM_MEMORY.buffer, fieldPtr);
377+
const originalField = TEST_TABLE.schema.fields[columnIndex];
378+
// declare it's not null
379+
const originalVector = TEST_TABLE.getChildAt(columnIndex) as arrow.Vector;
380+
const fieldPtr = FFI_TABLE.schemaAddr(columnIndex);
381+
const field = parseField(WASM_MEMORY.buffer, fieldPtr);
382382

383-
expect(field.name).toStrictEqual(originalField.name);
384-
expect(field.typeId).toStrictEqual(originalField.typeId);
385-
expect(field.nullable).toStrictEqual(originalField.nullable);
383+
expect(field.name).toStrictEqual(originalField.name);
384+
expect(field.typeId).toStrictEqual(originalField.typeId);
385+
expect(field.nullable).toStrictEqual(originalField.nullable);
386386

387-
const arrayPtr = FFI_TABLE.arrayAddr(0, columnIndex);
388-
const wasmVector = parseVector(WASM_MEMORY.buffer, arrayPtr, field.type);
387+
const arrayPtr = FFI_TABLE.arrayAddr(0, columnIndex);
388+
const wasmVector = parseVector(WASM_MEMORY.buffer, arrayPtr, field.type);
389389

390-
console.log(originalVector.get(0));
391-
console.log(wasmVector.get(0));
390+
console.log(originalVector.get(0));
391+
console.log(wasmVector.get(0));
392392

393-
t.ok(
394-
arraysEqual(originalVector.get(0), wasmVector.get(0)),
395-
"array values are equal"
396-
);
393+
expect(arraysEqual(originalVector.get(0), wasmVector.get(0))).toBeTruthy();
394+
});
397395
});
398396

399397
describe("date32", (t) => {

0 commit comments

Comments
 (0)