mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-23 06:38:07 +00:00
feat(Utils): add tests for isArray
This commit is contained in:
parent
735bd32be8
commit
e92e44f205
1 changed files with 52 additions and 33 deletions
|
|
@ -33,21 +33,6 @@ TestCase {
|
|||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
function test_snakeToCamel_data () {
|
||||
return [
|
||||
{ input: 'foo_bar', output: 'fooBar' },
|
||||
{ input: 'george_abitbol', output: 'georgeAbitbol' },
|
||||
{ input: 'billTremendousAndHubert', output: 'billTremendousAndHubert' },
|
||||
{ input: 'foo_bAr_BAZ', output: 'fooBArBAZ' }
|
||||
]
|
||||
}
|
||||
|
||||
function test_snakeToCamel (data) {
|
||||
compare(Utils.snakeToCamel(data.input), data.output)
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
function test_setTimeoutWithoutParent () {
|
||||
try {
|
||||
Utils.setTimeout(null, 0, function () {
|
||||
|
|
@ -138,24 +123,6 @@ TestCase {
|
|||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
function test_isString_data () {
|
||||
return [
|
||||
{ input: 'foo', output: true },
|
||||
{ input: Object('bar'), output: true },
|
||||
{ input: [ 0 ], output: false },
|
||||
{ input: /baz/, output: false },
|
||||
{ input: new Error, output: false },
|
||||
{ input: true, output: false },
|
||||
{ input: 42, output: false }
|
||||
]
|
||||
}
|
||||
|
||||
function test_isString (data) {
|
||||
compare(Utils.isString(data.input), data.output)
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
function test_genRandomNumber_data () {
|
||||
return [
|
||||
{ min: 42, max: 3600 },
|
||||
|
|
@ -212,6 +179,58 @@ TestCase {
|
|||
})
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
function test_isArray_data () {
|
||||
return [
|
||||
{ input: [], output: true },
|
||||
{ input: {}, output: false },
|
||||
{ input: [ 6 ], output: true },
|
||||
{ input: /bar/, output: false },
|
||||
{ input: new Error, output: false },
|
||||
{ input: true, output: false },
|
||||
{ input: 42, output: false },
|
||||
{ input: new Array(), output: true }
|
||||
]
|
||||
}
|
||||
|
||||
function test_isArray (data) {
|
||||
compare(Utils.isArray(data.input), data.output)
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
function test_isString_data () {
|
||||
return [
|
||||
{ input: 'foo', output: true },
|
||||
{ input: Object('bar'), output: true },
|
||||
{ input: [ 0 ], output: false },
|
||||
{ input: /baz/, output: false },
|
||||
{ input: new Error, output: false },
|
||||
{ input: true, output: false },
|
||||
{ input: 42, output: false }
|
||||
]
|
||||
}
|
||||
|
||||
function test_isString (data) {
|
||||
compare(Utils.isString(data.input), data.output)
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
function test_snakeToCamel_data () {
|
||||
return [
|
||||
{ input: 'foo_bar', output: 'fooBar' },
|
||||
{ input: 'george_abitbol', output: 'georgeAbitbol' },
|
||||
{ input: 'billTremendousAndHubert', output: 'billTremendousAndHubert' },
|
||||
{ input: 'foo_bAr_BAZ', output: 'fooBArBAZ' }
|
||||
]
|
||||
}
|
||||
|
||||
function test_snakeToCamel (data) {
|
||||
compare(Utils.snakeToCamel(data.input), data.output)
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
function test_startsWith_data () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue