Commit a4858e08 authored by GoshaZotov's avatar GoshaZotov

add tests for UNICODE formula

parent 789b75eb
......@@ -8530,5 +8530,34 @@ $( function () {
});
test( "Test: \"UNICODE\"", function () {
oParser = new parserFormula( 'UNICODE(" ")', "AA2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 32);
oParser = new parserFormula( 'UNICODE("B")', "AA2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 66);
oParser = new parserFormula( 'UNICODE(0)', "AA2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 48);
oParser = new parserFormula( 'UNICODE(1)', "AA2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 49);
oParser = new parserFormula( 'UNICODE("true")', "AA2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 116);
oParser = new parserFormula( 'UNICODE(#N/A)', "AA2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), "#N/A");
});
wb.dependencyFormulas.unlockRecal();
} );
......@@ -49,7 +49,7 @@
/*new funcions with _xlnf-prefix*/
cFormulaFunctionGroup['TextAndData'] = cFormulaFunctionGroup['TextAndData'] || [];
cFormulaFunctionGroup['TextAndData'].push(cDBCS, cUNICHAR, cUNICODE);
cFormulaFunctionGroup['TextAndData'].push(cDBCS, cUNICHAR);
cFormulaFunctionGroup['Statistical'] = cFormulaFunctionGroup['Statistical'] || [];
cFormulaFunctionGroup['Statistical'].push(cF_TEST, cFORECAST_ETS, cFORECAST_ETS_CONFINT,
cFORECAST_ETS_SEASONALITY, cFORECAST_ETS_STAT, cHYPGEOM_DIST);
......@@ -61,7 +61,7 @@
cFormulaFunctionGroup['LookupAndReference'].push(cFORMULATEXT);
cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || [];
cFormulaFunctionGroup['NotRealised'].push(cDBCS, cUNICHAR, cUNICODE, cF_TEST, cFORECAST_ETS,
cFormulaFunctionGroup['NotRealised'].push(cDBCS, cUNICHAR, cF_TEST, cFORECAST_ETS,
cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY, cFORECAST_ETS_STAT, cHYPGEOM_DIST, cPDURATION,
cMUNIT, cFORMULATEXT);
......@@ -221,18 +221,6 @@
cUNICHAR.prototype = Object.create(cBaseFunction.prototype);
cUNICHAR.prototype.constructor = cUNICHAR;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cUNICODE() {
cBaseFunction.call(this, "UNICODE");
this.isXLFN = true;
}
cUNICODE.prototype = Object.create(cBaseFunction.prototype);
cUNICODE.prototype.constructor = cUNICODE;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
......
......@@ -1932,7 +1932,7 @@
var oArguments = this._prepareArguments(arg, arguments[1]);
var argClone = oArguments.args;
var arg0 = argClone[0].tocString();
argClone[0] = argClone[0].tocString();
var argError;
if (argError = this._checkErrorArg(argClone)) {
......
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