@@ -274,13 +274,18 @@ suite('DatabaseSync.prototype.function()', () => {
|
274 | 274 | db.function('retString', () => { return 'foo'; }); |
275 | 275 | db.function('retBigInt', () => { return 5n; }); |
276 | 276 | db.function('retUint8Array', () => { return new Uint8Array([1, 2, 3]); }); |
| 277 | +db.function('retArrayBufferView', () => { |
| 278 | +const arrayBuffer = new Uint8Array([1, 2, 3]).buffer; |
| 279 | +return new DataView(arrayBuffer); |
| 280 | +}); |
277 | 281 | const stmt = db.prepare(`SELECT |
278 | 282 | retUndefined() AS retUndefined, |
279 | 283 | retNull() AS retNull, |
280 | 284 | retNumber() AS retNumber, |
281 | 285 | retString() AS retString, |
282 | 286 | retBigInt() AS retBigInt, |
283 | | - retUint8Array() AS retUint8Array |
| 287 | + retUint8Array() AS retUint8Array, |
| 288 | + retArrayBufferView() AS retArrayBufferView |
284 | 289 | `); |
285 | 290 | assert.deepStrictEqual(stmt.get(), { |
286 | 291 | __proto__: null, |
@@ -290,6 +295,7 @@ suite('DatabaseSync.prototype.function()', () => {
|
290 | 295 | retString: 'foo', |
291 | 296 | retBigInt: 5, |
292 | 297 | retUint8Array: new Uint8Array([1, 2, 3]), |
| 298 | +retArrayBufferView: new Uint8Array([1, 2, 3]), |
293 | 299 | }); |
294 | 300 | }); |
295 | 301 | |
|