1
0

Improved error reporting on incorrect arguments
Some checks failed
Lua Library / Lua-Testing (push) Failing after 7s
Lua Library / Static-Analysis (push) Successful in 4s

This commit is contained in:
Jon Michael Aanes 2024-05-05 20:13:45 +02:00
parent ef9c34b7cd
commit 32c88386f3
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA

View File

@ -86,10 +86,10 @@ local function correct_error (self, module_suffix, format_msg, gotten_string, po
assert(type(module_suffix) == 'string') assert(type(module_suffix) == 'string')
format_msg = format_msg or DEFAULT_ERROR_MSG_CORRECT format_msg = format_msg or DEFAULT_ERROR_MSG_CORRECT
lvl = lvl or 0 lvl = lvl or 0
assert(type(format_msg) == 'string') assert(type(format_msg) == 'string', 'Internal errors error: incorrect type for argument format_msg')
assert(type(gotten_string) == 'string') assert(type(gotten_string) == 'string', 'Internal errors error: incorrect type for argument gotten_string')
assert(type(possible_strings) == 'table') assert(type(possible_strings) == 'table', 'Internal errors error: incorrect type for argument possible_strings')
assert(type(lvl) == 'number') assert(type(lvl) == 'number', 'Internal errors error: incorrect type for argument lvl')
-- Do stuff -- Do stuff
possible_strings = string_dist.strings_with_highest_similarity(gotten_string, possible_strings) possible_strings = string_dist.strings_with_highest_similarity(gotten_string, possible_strings)