Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
9d179b89
Commit
9d179b89
authored
Aug 18, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ tests for CONVERT formula
parent
de7b71fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
0 deletions
+80
-0
cell/.unit-tests/FormulaTests.js
cell/.unit-tests/FormulaTests.js
+80
-0
No files found.
cell/.unit-tests/FormulaTests.js
View file @
9d179b89
...
...
@@ -6798,6 +6798,86 @@ $( function () {
ok
(
oParser
.
parse
(),
'
CONVERT(CONVERT(100,"ft","m"),"ft","m")
'
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
9.290304
,
'
CONVERT(CONVERT(100,"ft","m"),"ft","m")
'
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"bit","byte")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
3
)
-
0
,
0.875
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"admkn","kn")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
14
)
-
0
,
6.99999939524838
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"admkn","m/s")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
3.6011108
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"admkn","mph")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
8.0554554
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"m/h","m/sec")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
0.0019444
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"m/hr","mph")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
0.0043496
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"m","mi")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
0.0043496
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"m","Pica")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
19842.5196850
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"m","pica")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
1653.5433071
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"Nmi","pica")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
3062362.2047251
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"yr","day")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
(),
2556.75
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"yr","min")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
(),
3681720
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"day","min")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
(),
10080
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"hr","sec")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
(),
25200
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"min","sec")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
(),
420
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"Pa","mmHg")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
0.0525043
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"Pa","psi")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
0.0010153
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"Pa","Torr")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
0.0525045
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"g","sg")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
0.0004797
);
oParser
=
new
parserFormula
(
'
CONVERT(7,"g","lbm")
'
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
7
)
-
0
,
0.0154324
);
}
);
test
(
"
Test:
\"
PRICE
\"
"
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment