Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
910deeb0
Commit
910deeb0
authored
Nov 10, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Utils): add tests for `ensureArray`
parent
64e5a70b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
utils.spec.qml
tests/ui/scripts/Utils/utils.spec.qml
+18
-0
No files found.
tests/ui/scripts/Utils/utils.spec.qml
View file @
910deeb0
...
...
@@ -129,6 +129,24 @@ TestCase {
// GENERIC.
// =================================================================
function
test_ensureArray_data
()
{
return
[
{
input
:
[
1
,
2
,
3
],
output
:
[
1
,
2
,
3
]
},
{
input
:
{
toto
:
4
,
ro
:
5
},
output
:
[
4
,
5
]
},
{
input
:
new
Object
(),
output
:
[]
},
{
input
:
new
Array
(),
output
:
[]
},
{
input
:
{
a
:
0
,
b
:
1
,
c
:
0
},
output
:
[
0
,
1
,
0
]
}
]
}
function
test_ensureArray
(
data
)
{
// Use `sort` because transform a object in array hasn't a
// guarantee order.
compare
(
Utils
.
ensureArray
(
data
.
input
).
sort
(),
data
.
output
.
sort
())
}
// -----------------------------------------------------------------
function
test_genRandomNumber_data
()
{
return
[
{
min
:
42
,
max
:
3600
},
...
...
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