summaryrefslogtreecommitdiff
path: root/test/test-database.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-10-14 21:26:53 -0400
committerGitHub <noreply@github.com>2021-10-14 21:26:53 -0400
commit75aabd983da29023b8423bd44d565202aad6b664 (patch)
tree754fbe5457747cd72fcf13767fc3176fc0d8f280 /test/test-database.js
parent11f7591a7f5fcbfc3a3e631eaac0addb228c988a (diff)
String frequency support (#1989)
* Restore support for string frequency values * Add support for {value, displayValue} frequencies * Update test data * Improve number parsing of string frequencies * Improve reading detection * Expose a displayValue property for frequency information * Update docs * Expose displayValue to Anki note data * Fix translator * Update display generation * Update test data * Update counts
Diffstat (limited to 'test/test-database.js')
-rw-r--r--test/test-database.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/test-database.js b/test/test-database.js
index c24dedbd..20eb6fe0 100644
--- a/test/test-database.js
+++ b/test/test-database.js
@@ -151,10 +151,10 @@ async function testDatabase1() {
prefixWildcardsSupported: true,
counts: {
kanji: {total: 2},
- kanjiMeta: {total: 2, freq: 2},
+ kanjiMeta: {total: 6, freq: 6},
media: {total: 4},
tagMeta: {total: 15},
- termMeta: {total: 16, freq: 9, pitch: 7},
+ termMeta: {total: 38, freq: 31, pitch: 7},
terms: {total: 20}
}
};
@@ -182,8 +182,8 @@ async function testDatabase1() {
true
);
vm.assert.deepStrictEqual(counts, {
- counts: [{kanji: 2, kanjiMeta: 2, terms: 20, termMeta: 16, tagMeta: 15, media: 4}],
- total: {kanji: 2, kanjiMeta: 2, terms: 20, termMeta: 16, tagMeta: 15, media: 4}
+ counts: [{kanji: 2, kanjiMeta: 6, terms: 20, termMeta: 38, tagMeta: 15, media: 4}],
+ total: {kanji: 2, kanjiMeta: 6, terms: 20, termMeta: 38, tagMeta: 15, media: 4}
});
// Test find* functions
@@ -569,9 +569,9 @@ async function testFindTermMetaBulk1(database, titles) {
}
],
expectedResults: {
- total: 3,
+ total: 11,
modes: [
- ['freq', 3]
+ ['freq', 11]
]
}
},
@@ -582,9 +582,9 @@ async function testFindTermMetaBulk1(database, titles) {
}
],
expectedResults: {
- total: 3,
+ total: 10,
modes: [
- ['freq', 3]
+ ['freq', 10]
]
}
},
@@ -595,9 +595,9 @@ async function testFindTermMetaBulk1(database, titles) {
}
],
expectedResults: {
- total: 5,
+ total: 12,
modes: [
- ['freq', 3],
+ ['freq', 10],
['pitch', 2]
]
}
@@ -687,9 +687,9 @@ async function testFindKanjiMetaBulk1(database, titles) {
}
],
expectedResults: {
- total: 1,
+ total: 3,
modes: [
- ['freq', 1]
+ ['freq', 3]
]
}
},
@@ -700,9 +700,9 @@ async function testFindKanjiMetaBulk1(database, titles) {
}
],
expectedResults: {
- total: 1,
+ total: 3,
modes: [
- ['freq', 1]
+ ['freq', 3]
]
}
},