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
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-10-14 21:31:03 -0400
commit858fe7ae11850eaafb3e024289faf0c78e083abf (patch)
tree701390a05b3163199c06d7cf2482d13c6f61b1a2 /test/test-database.js
parentf6c346136297c10389897b183db4f05c07d204fa (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]
]
}
},