-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
153 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
export * from './dbm'; | ||
export * from './file-manager'; | ||
export * from './logger'; | ||
export * from './utils/duck-type-convertor'; | ||
export { | ||
convertArrowTableToJSON, | ||
convertSharedArrayBufferToUint8Array, | ||
convertUint8ArrayToSharedArrayBuffer, | ||
getMainAppName, | ||
getRunnerAppName, | ||
} from './utils'; | ||
export * from './utils/parallel-dbm-utils/get-app-name'; | ||
export * from './window-communication/runner-types'; | ||
export * from './window-communication/window-communication'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { | ||
convertSharedArrayBufferToUint8Array, | ||
convertUint8ArrayToSharedArrayBuffer, | ||
} from '../array-convertor'; | ||
|
||
describe('Buffer Conversion Functions', () => { | ||
test('convertUint8ArrayToSharedArrayBuffer should correctly convert Uint8Array to SharedArrayBuffer', () => { | ||
// Input Uint8Array | ||
const inputArray = new Uint8Array([1, 2, 3, 4, 5]); | ||
|
||
// Convert to SharedArrayBuffer | ||
const sharedBuffer = convertUint8ArrayToSharedArrayBuffer(inputArray); | ||
|
||
// Create a view of the SharedArrayBuffer | ||
const sharedArrayView = new Uint8Array(sharedBuffer); | ||
|
||
// Assert that the SharedArrayBuffer has the same length and data as the input Uint8Array | ||
expect(sharedArrayView.byteLength).toBe(inputArray.length); | ||
expect(sharedArrayView).toEqual(inputArray); | ||
}); | ||
|
||
test('convertSharedArrayBufferToUint8Array should correctly convert SharedArrayBuffer to Uint8Array', () => { | ||
// Input SharedArrayBuffer | ||
const inputArray = new Uint8Array([10, 20, 30, 40, 50]); | ||
const sharedBuffer = convertUint8ArrayToSharedArrayBuffer(inputArray); | ||
|
||
// Convert back to Uint8Array | ||
const resultArray = convertSharedArrayBufferToUint8Array(sharedBuffer); | ||
|
||
// Assert that the Uint8Array has the same length and data as the original input | ||
expect(resultArray.length).toBe(inputArray.length); | ||
expect(resultArray).toEqual(inputArray); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export * from './array-convertor'; | ||
export * from './duck-type-convertor'; | ||
export * from './get-buffer-from-json'; | ||
export * from './is-defined'; | ||
export * from './merge-file-buffer-store-into-table'; | ||
export * from './parallel-dbm-utils/get-app-name'; |