summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/from/from-string.js
blob: 88772a85ecb6e6922ce08900102b832a5e297201 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright (c) 2014 Hank Yates. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-array.from
description: Testing Array.from when passed a String
author: Hank Yates (hankyates@gmail.com)
---*/

var arrLikeSource = 'Test';
var result = Array.from(arrLikeSource);

assert.sameValue(result.length, 4, 'The value of result.length is expected to be 4');
assert.sameValue(result[0], 'T', 'The value of result[0] is expected to be "T"');
assert.sameValue(result[1], 'e', 'The value of result[1] is expected to be "e"');
assert.sameValue(result[2], 's', 'The value of result[2] is expected to be "s"');
assert.sameValue(result[3], 't', 'The value of result[3] is expected to be "t"');

reportCompare(0, 0);