Update empty and notEmpty specs for better IE11 support
This commit is contained in:
@@ -24,15 +24,21 @@ describe("Empty", function () {
|
|||||||
it("matches an empty map", function () {
|
it("matches an empty map", function () {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var empty = new jasmineUnderTest.Empty();
|
var empty = new jasmineUnderTest.Empty();
|
||||||
|
var fullMap = new Map();
|
||||||
|
fullMap.set('thing', 2);
|
||||||
|
|
||||||
expect(empty.asymmetricMatch(new Map())).toBe(true);
|
expect(empty.asymmetricMatch(new Map())).toBe(true);
|
||||||
|
expect(empty.asymmetricMatch(fullMap)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches an empty map", function () {
|
it("matches an empty map", function () {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
var empty = new jasmineUnderTest.Empty();
|
var empty = new jasmineUnderTest.Empty();
|
||||||
|
var fullSet = new Set();
|
||||||
|
fullSet.add(3);
|
||||||
|
|
||||||
expect(empty.asymmetricMatch(new Set())).toBe(true);
|
expect(empty.asymmetricMatch(new Set())).toBe(true);
|
||||||
|
expect(empty.asymmetricMatch(fullSet)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches an empty typed array", function() {
|
it("matches an empty typed array", function() {
|
||||||
@@ -40,5 +46,6 @@ describe("Empty", function () {
|
|||||||
var empty = new jasmineUnderTest.Empty();
|
var empty = new jasmineUnderTest.Empty();
|
||||||
|
|
||||||
expect(empty.asymmetricMatch(new Int16Array())).toBe(true);
|
expect(empty.asymmetricMatch(new Int16Array())).toBe(true);
|
||||||
|
expect(empty.asymmetricMatch(new Int16Array([1,2]))).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -24,19 +24,23 @@ describe("NotEmpty", function () {
|
|||||||
it("matches a non empty map", function () {
|
it("matches a non empty map", function () {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var notEmpty = new jasmineUnderTest.NotEmpty();
|
var notEmpty = new jasmineUnderTest.NotEmpty();
|
||||||
var fullMap = new Map([['one',1]]);
|
var fullMap = new Map();
|
||||||
|
fullMap.set('one', 1);
|
||||||
var emptyMap = new Map();
|
var emptyMap = new Map();
|
||||||
|
|
||||||
expect(notEmpty.asymmetricMatch(fullMap)).toBe(true);
|
expect(notEmpty.asymmetricMatch(fullMap)).toBe(true);
|
||||||
expect(notEmpty.asymmetricMatch(emptyMap)).toBe(false);
|
expect(notEmpty.asymmetricMatch(emptyMap)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches a non empty map", function () {
|
it("matches a non empty set", function () {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var notEmpty = new jasmineUnderTest.NotEmpty();
|
var notEmpty = new jasmineUnderTest.NotEmpty();
|
||||||
var filledSet = new Set([1,2,2,2,2,34]);
|
var filledSet = new Set();
|
||||||
|
filledSet.add(1);
|
||||||
|
var emptySet = new Set();
|
||||||
|
|
||||||
expect(notEmpty.asymmetricMatch(filledSet)).toBe(true);
|
expect(notEmpty.asymmetricMatch(filledSet)).toBe(true);
|
||||||
|
expect(notEmpty.asymmetricMatch(emptySet)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches an empty typed array", function() {
|
it("matches an empty typed array", function() {
|
||||||
@@ -44,5 +48,6 @@ describe("NotEmpty", function () {
|
|||||||
var notEmpty = new jasmineUnderTest.NotEmpty();
|
var notEmpty = new jasmineUnderTest.NotEmpty();
|
||||||
|
|
||||||
expect(notEmpty.asymmetricMatch(new Int16Array([1,2,3]))).toBe(true);
|
expect(notEmpty.asymmetricMatch(new Int16Array([1,2,3]))).toBe(true);
|
||||||
|
expect(notEmpty.asymmetricMatch(new Int16Array())).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user