test262/test/built-ins/Array/from/from-string.js
Rick Waldron 452c0e5c61
Automated assertion message update: Array * (#3140)
* Automated assertion message update: Array.from

* Automated assertion message update: Array.isArray

* Automated assertion message update: Array length property

* Automated assertion message update: Array.of

* Automated assertion message update: Array

* Automated assertion message update: Array.prototype.at

* Automated assertion message update: Array.prototype.concat

* Automated assertion message update: compareArray -> assert.compareArray
2021-08-10 14:51:54 -07:00

18 lines
738 B
JavaScript

// 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"');