diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2015-03-16 15:17:50 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2015-04-07 16:53:18 -0400 |
commit | 59e2a7ac57535fffcfe73f9ec919fc3f364c832b (patch) | |
tree | 91c5cbf908b6403e113e05c6daa682b3296b5c13 /test/built-ins/Map | |
parent | 2df6c4f219ecf883772ce02582f06112a07f18da (diff) | |
download | qtdeclarative-testsuites-59e2a7ac57535fffcfe73f9ec919fc3f364c832b.tar.gz |
Import tests from Google V8 (Symbol)
These tests are derived from the following files within the Google V8 project:
test/mjsunit/harmony/private.js
Diffstat (limited to 'test/built-ins/Map')
-rw-r--r-- | test/built-ins/Map/symbol-as-entry-key.js | 19 | ||||
-rw-r--r-- | test/built-ins/Map/symbol-species.js | 18 |
2 files changed, 37 insertions, 0 deletions
diff --git a/test/built-ins/Map/symbol-as-entry-key.js b/test/built-ins/Map/symbol-as-entry-key.js new file mode 100644 index 000000000..cf82d615a --- /dev/null +++ b/test/built-ins/Map/symbol-as-entry-key.js @@ -0,0 +1,19 @@ +// Copyright (C) Copyright 2013 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 19.4 +description: > + Symbol as Map key +features: [Map] +---*/ +var map = new Map(); +var sym = Symbol(); + +map.set(sym, 1); + +assert.sameValue(map.size, 1, "The value of `map.size` is `1`, after executing `map.set(sym, 1)`"); +assert.sameValue(map.has(sym), true, "`map.has(sym)` returns `true`"); +assert.sameValue(map.get(sym), 1, "`map.get(sym)` returns `1`"); +assert.sameValue(map.delete(sym), true, "`map.delete(sym)` returns `true`"); +assert.sameValue(map.size, 0, "The value of `map.size` is `0`"); + diff --git a/test/built-ins/Map/symbol-species.js b/test/built-ins/Map/symbol-species.js new file mode 100644 index 000000000..ca9742b71 --- /dev/null +++ b/test/built-ins/Map/symbol-species.js @@ -0,0 +1,18 @@ +// Copyright 2015 Cubane Canada, Inc. All rights reserved. +// See LICENSE for details. + +/*--- +info: > + Map has a property at `Symbol.species` +es6id: 23.1.2.2 +author: Sam Mikes +description: Map[Symbol.species] exists per spec +includes: + - propertyHelper.js +---*/ + +assert.sameValue(Map[Symbol.species], Map, "Map[Symbol.species] is Map"); + +verifyNotWritable(Map, Symbol.species, Symbol.species); +verifyNotEnumerable(Map, Symbol.species); +verifyConfigurable(Map, Symbol.species); |