From 2d57d69b9ed3adf1241074f7eb29a588bec817a2 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 31 Jul 2021 10:53:35 -0400 Subject: Improve dictionary importer (#1859) * Optimize dictionary data parsing during import * Use ArrayBuffer instead of string * Add missing function for testing --- test/test-database.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/test-database.js b/test/test-database.js index f2a7efdd..19ac49e2 100644 --- a/test/test-database.js +++ b/test/test-database.js @@ -86,7 +86,7 @@ function clearDatabase(timeout) { async function testDatabase1() { // Load dictionary data const testDictionary = createTestDictionaryArchive('valid-dictionary1'); - const testDictionarySource = await testDictionary.generateAsync({type: 'string'}); + const testDictionarySource = await testDictionary.generateAsync({type: 'arraybuffer'}); const testDictionaryIndex = JSON.parse(await testDictionary.files['index.json'].async('string')); const title = testDictionaryIndex.title; @@ -766,7 +766,7 @@ async function testFindTagForTitle1(database, title) { async function testDatabase2() { // Load dictionary data const testDictionary = createTestDictionaryArchive('valid-dictionary1'); - const testDictionarySource = await testDictionary.generateAsync({type: 'string'}); + const testDictionarySource = await testDictionary.generateAsync({type: 'arraybuffer'}); const testDictionaryIndex = JSON.parse(await testDictionary.files['index.json'].async('string')); const title = testDictionaryIndex.title; @@ -823,7 +823,7 @@ async function testDatabase3() { for (const invalidDictionary of invalidDictionaries) { const testDictionary = createTestDictionaryArchive(invalidDictionary); - const testDictionarySource = await testDictionary.generateAsync({type: 'string'}); + const testDictionarySource = await testDictionary.generateAsync({type: 'arraybuffer'}); let error = null; try { -- cgit v1.2.3