Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
afb6f590
Commit
afb6f590
authored
Oct 18, 2017
by
Mathieu Giraud
Committed by
aurelien beliard
Oct 19, 2017
Browse files
tests: add tests
parent
6bd29887
Changes
1
Hide whitespace changes
Inline
Side-by-side
browser/test/QUnit/testFiles/tools_test.js
View file @
afb6f590
...
...
@@ -33,11 +33,15 @@ QUnit.test("floatToFixed", function(assert) {
QUnit
.
test
(
"
test rounding functions
"
,
function
(
assert
)
{
assert
.
equal
(
floor_pow10
(
0.072
),
0.01
,
"
nice_floor_pow10 0.072
"
);
assert
.
equal
(
nice_ceil
(
0
),
0
,
"
rounding 0
"
);
assert
.
equal
(
nice_ceil
(
0.072
),
0.08
,
"
rounding 0.08
"
);
assert
.
equal
(
nice_ceil
(
1.2
),
1.5
,
"
rounding 1.2
"
);
assert
.
equal
(
nice_ceil
(
18
),
20
,
"
rounding 1.2
"
);
assert
.
equal
(
nice_ceil
(
100
),
100
,
"
rounding 100
"
);
assert
.
equal
(
nice_floor
(
0
),
0
,
"
rounding 0
"
);
assert
.
equal
(
nice_floor
(
0.072
),
0.07
,
"
rounding 0.072
"
);
assert
.
equal
(
nice_floor
(
100
),
100
,
"
rounding 100
"
);
assert
.
equal
(
nice_floor
(
451
),
400
,
"
rounding 451
"
);
...
...
Write
Preview
Supports
Markdown
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