mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-09-23 10:22:54 +00:00
Error message for formatNum should not refer to formatDate
These new error messages were referring to formatDate instead of formatNum. Change-Id: Ic20a5a5515ee55d46087449627138cc779909ec3 Follow-up: Ib7706ad40f7ee2da6ab7c6b2dab6ae8d129dab52 Bug: T268758
This commit is contained in:
parent
d3e3124652
commit
d65c61e49b
|
@ -298,10 +298,10 @@ class Scribunto_LuaLanguageLibrary extends Scribunto_LuaLibraryBase {
|
|||
$num = $args[0];
|
||||
$this->checkType( 'formatNum', 1, $num, 'number' );
|
||||
if ( is_infinite( $num ) ) {
|
||||
throw new Scribunto_LuaError( "bad argument #1 to 'formatDate' (infinite)" );
|
||||
throw new Scribunto_LuaError( "bad argument #1 to 'formatNum' (infinite)" );
|
||||
}
|
||||
if ( is_nan( $num ) ) {
|
||||
throw new Scribunto_LuaError( "bad argument #1 to 'formatDate' (NaN)" );
|
||||
throw new Scribunto_LuaError( "bad argument #1 to 'formatNum' (NaN)" );
|
||||
}
|
||||
|
||||
$noCommafy = false;
|
||||
|
|
|
@ -252,9 +252,9 @@ return testframework.getTestProvider( {
|
|||
{ name = 'lang:formatNum (NaN)', func = test_method,
|
||||
args = { 'formatNum', 0/0 },
|
||||
expect = {
|
||||
"bad argument #1 to 'formatDate' (NaN)",
|
||||
"bad argument #1 to 'formatDate' (NaN)",
|
||||
"bad argument #1 to 'formatDate' (NaN)",
|
||||
"bad argument #1 to 'formatNum' (NaN)",
|
||||
"bad argument #1 to 'formatNum' (NaN)",
|
||||
"bad argument #1 to 'formatNum' (NaN)",
|
||||
"language code '[[bogus]]' is invalid",
|
||||
}
|
||||
},
|
||||
|
@ -262,9 +262,9 @@ return testframework.getTestProvider( {
|
|||
{ name = 'lang:formatNum (Inf)', func = test_method,
|
||||
args = { 'formatNum', 1/0 },
|
||||
expect = {
|
||||
"bad argument #1 to 'formatDate' (infinite)",
|
||||
"bad argument #1 to 'formatDate' (infinite)",
|
||||
"bad argument #1 to 'formatDate' (infinite)",
|
||||
"bad argument #1 to 'formatNum' (infinite)",
|
||||
"bad argument #1 to 'formatNum' (infinite)",
|
||||
"bad argument #1 to 'formatNum' (infinite)",
|
||||
"language code '[[bogus]]' is invalid",
|
||||
}
|
||||
},
|
||||
|
@ -272,9 +272,9 @@ return testframework.getTestProvider( {
|
|||
{ name = 'lang:formatNum (-Inf)', func = test_method,
|
||||
args = { 'formatNum', -1/0 },
|
||||
expect = {
|
||||
"bad argument #1 to 'formatDate' (infinite)",
|
||||
"bad argument #1 to 'formatDate' (infinite)",
|
||||
"bad argument #1 to 'formatDate' (infinite)",
|
||||
"bad argument #1 to 'formatNum' (infinite)",
|
||||
"bad argument #1 to 'formatNum' (infinite)",
|
||||
"bad argument #1 to 'formatNum' (infinite)",
|
||||
"language code '[[bogus]]' is invalid",
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue