Commit 8ff60a53 authored by GoshaZotov's avatar GoshaZotov

add tests for ISOWEEKNUM

parent f9a9765c
......@@ -2767,6 +2767,36 @@ $( function () {
} );
test( "Test: \"ISOWEEKNUM\"", function () {
ws.getRange2( "A2" ).setValue( "3/9/2012" );
oParser = new parserFormula( "ISOWEEKNUM(A2)", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 10 );
oParser = new parserFormula( "ISOWEEKNUM(123)", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 18 );
oParser = new parserFormula( "ISOWEEKNUM(120003)", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 30 );
oParser = new parserFormula( "ISOWEEKNUM(120003)", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 30 );
oParser = new parserFormula( "ISOWEEKNUM(-100)", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), "#NUM!" );
oParser = new parserFormula( "ISOWEEKNUM(1203)", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 16 );
} );
test( "Test: \"WEIBULL\"", function () {
ws.getRange2( "A2" ).setValue( "105" );
......
......@@ -1063,6 +1063,7 @@
cISOWEEKNUM.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cISOWEEKNUM.prototype.isXLFN = true;
cISOWEEKNUM.prototype.Calculate = function (arg) {
//TODO есть различия в результатах с формулой ISOWEEKNUM(1)
var oArguments = this._prepareArguments(arg, arguments[1], true);
var argClone = oArguments.args;
......@@ -1078,8 +1079,7 @@
return this.value = new cError(cErrorType.not_numeric);
}
return this.value =
new cNumber(weekNumber(Date.prototype.getDateFromExcel(arg0.getValue())));
return this.value = new cNumber(weekNumber(Date.prototype.getDateFromExcel(arg0.getValue())));
};
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment