it('should match elements', function(){ assert('element' === type(document.createElement('div'))) })
it('should match textnodes', function(){ assert('text-node' === type(document.createTextNode('div'))) })
it('should allow shorter patterns', function(){ assert(!match([1,2], [1,2,3])) assert(match([1,2], [1])) })
it('should match strings', function(){ assert('string' === type("test")) assert('string' === type(new String('whoop'))) })
it('boolean', function(){ assert(!match(true, false)) assert(match(true, true)) })
it('should deeply match', function(){ assert(!match({a:1,b:2}, {a:2})) assert(match({a:1,b:2}, {a:1})) assert(match({a:{a:1},b:2}, {a:{a:1}})) assert(match({a:'abc'}, {a:/^\w+$/})) })
it('should match regexps', function(){ assert('regexp' === type(/asdf/)) assert('regexp' === type(new RegExp('weee'))) })
if (typeof Blob == 'function') it('should match blobs', function(){ assert('blob' === type(new Blob)) })
it('should match undefined', function(){ assert('undefined' === type(undefined)) })
it('should match arrays', function(){ assert('array' === type([])) })
it('should match null', function(){ assert('null' === type(null)) })
it('should match booleans', function(){ assert('boolean' === type(true)) assert('boolean' === type(false)) assert('boolean' === type(new Boolean(false))) })
it('should match dates', function(){ assert('date' === type(new Date)) })
if (typeof FormData == 'function') it('should match from data', function(){ assert('form-data' === type(new FormData)) })
it('should match functions', function(){ assert('function' === type(function(){})) })
if (typeof File == 'function') it.skip('should match files', function(){ assert('file' === type(new File)) // TODO: fix test })
it('should match objects', function(){ function Foo(){} assert('object' === type({})) assert('object' === type(new Foo)) })
it('regexp', function(){ assert(!match(/a/, /ab/)) assert(match(/a/, /a/)) assert(!match('a', /b/)) assert(match('a', /a/)) })
it('should match arguments', function(){ assert('arguments' === type((function(){ return arguments })())) })
it('functions', function(){ function add(){ return 1 + 1 } assert(match(add, /\+/)) assert(match(add, function add(){ return 1 + 1 })) })
it('should match typed arrays', function () { assert('bit-array' === type(new Uint8Array)) assert('bit-array' === type(new Uint16Array)) assert('bit-array' === type(new Uint32Array)) })
it('strings', function(){ assert(!match('a', 'b')) assert(match('a', 'a')) })
it('should match errors', function(){ assert('error' === type(new Error)) assert('error' === type(new TypeError)) assert('error' === type(new RangeError)) assert('error' === type(new SyntaxError)) })
it('numbers', function(){ assert(!match(1, 2)) assert(match(1, 1)) })
it('should match numbers', function(){ assert('number' === type(12)) assert('number' === type(new Number(12))) })