Created
March 15, 2018 00:43
-
-
Save a-one-d-one/913f5830b5bbfb1c7b6abf37eed79100 to your computer and use it in GitHub Desktop.
Lab4 DPS909
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2015 the V8 project authors. All rights reserved. | |
// This code is governed by the BSD license found in the LICENSE file. | |
/*--- | |
description: > | |
Spares arrays are only equivalent if they have the same length. | |
includes: [compareArray.js] | |
---*/ | |
var assert = require('assert'); | |
// if (compareArray([,], [,]) !== true) { | |
// $ERROR('Sparse arrays of the same length are equivalent.'); | |
// } | |
/**** ^^^ EDITED ****/ | |
assert.notDeepStrictEqual([,], [,], 'Sparse arrays of the same length are equivalent.'); | |
// if (compareArray([,], [,,]) !== false) { | |
// $ERROR('Sparse arrays of differing lengths are not equivalent.'); | |
// } | |
/**** ^^^ EDITED ****/ | |
assert.deepStrictEqual([,], [,,], 'Sparse arrays of differing lengths are not equivalent.'); | |
// if (compareArray([,,], [,]) !== false) { | |
// $ERROR('Sparse arrays of differing lengths are not equivalent.'); | |
// } | |
/**** ^^^ EDITED ****/ | |
assert.deepStrictEqual([,,], [,], 'Sparse arrays of differing lengths are not equivalent.'); | |
// if (compareArray([,], []) !== false) { | |
// $ERROR('Sparse arrays are not equivalent to empty arrays.'); | |
// } | |
/**** ^^^ EDITED ****/ | |
assert.deepStrictEqual([,], [], 'Sparse arrays are not equivalent to empty arrays.'); | |
// if (compareArray([], [,]) !== false) { | |
// $ERROR('Sparse arrays are not equivalent to empty arrays.'); | |
// } | |
/**** ^^^ EDITED ****/ | |
assert.deepStrictEqual([], [,], 'Sparse arrays are not equivalent to empty arrays.'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment