tests: fix translator tests tags

This commit is contained in:
Benoit Pierre
2024-12-25 15:46:18 +01:00
committed by Frans de Jonge
parent d2d62d8550
commit fbcda02726

View File

@@ -35,12 +35,11 @@ describe("Translator module", function()
-- be between about 100 and 130 characters
assert.is_true(#translation_result > 50 and #translation_result < 200)
end)
it("should include romanization results when configured to be shown", function()
it("should include romanization results when configured to be shown #internet", function()
G_reader_settings:saveSetting("translator_with_romanizations", true)
local translation_result = Translator:loadPage(chinese_wikipedia_text, "en", "auto")
local romanizations = getRomanizations(translation_result)
assert.is.same(1, #romanizations)
-- The word free (zìyóu) appears 3 times in the romanization
local free_index = string.find(romanizations[1], "zìyóu")
assert.is.truthy(free_index)
@@ -49,7 +48,7 @@ describe("Translator module", function()
free_index = string.find(romanizations[1], "zìyóu", free_index + 1)
assert.is.truthy(free_index)
end)
it("should not include romanization results when not configured to be shown", function()
it("should not include romanization results when not configured to be shown #internet", function()
G_reader_settings:saveSetting("translator_with_romanizations", false)
assert.is_false(G_reader_settings:isTrue("translator_with_romanizations"))
local translation_result = Translator:loadPage(chinese_wikipedia_text, "en", "auto")