<!doctype html><html><head><meta charset="utf-8"></head><body><pre id="__testling_output"></pre><script>(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (process){
var xws = require('xhr-write-stream');
var Stream = require('stream');
var inspect = require('object-inspect');
process.on = function () {};
var ws = xws('/__testling/sock');
ws.write(window.location.hash + '\n');
function createChannel (writeListen) {
var c = new Stream;
c.writable = true;
c.write = function (buf) {
if (writeListen) writeListen(buf);
return ws.write(String(buf));
};
c.destroy = function () {};
c.end = function (buf) {
c.emit('close');
};
return c;
}
var lastTestId = 0;
process.stdout = createChannel(function (buf) {
var m = /^(?:not )? ok (\d+)/.exec(String(buf));
if (m) lastTestId = m[1];
});
process.stderr = createChannel();
process.stdout.on('close', function () { ws.end() });
process.exit = function () { ws.end() };
var oldError = window.onerror;
window.onerror = function (err, url, lineNum) {
var type = err && err.name || 'Error';
process.stdout.write(
'not ok ' + (lastTestId + 1) + ' ' + type + ': '
+ (err && err.message || String(err))
+ (lineNum ? ' on line ' + lineNum : '')
+ '\n'
);
if (err && err.stack) {
var lines = String(err.stack).split('\n');
var xs = [];
for (var i = 0; i < lines.length; i++) {
xs.push(' ' + lines[i]);
}
process.stdout.write([
' ---',
' stack:',
xs.join('\n'),
' ...'
].join('\n') + '\n');
}
ws.end();
if (typeof oldError === 'function') {
return oldError.apply(this, arguments);
}
};
window.__testlingErrorHandler = onerror;
if (typeof console === 'undefined') {
console = {};
}
var params = (function () {
var unesc = typeof decodeURIComponent !== 'undefined'
? decodeURIComponent : unescape
;
var parts = (window.location.search || '').replace(/^\?/, '').split('&');
var opts = {};
for (var i = 0; i < parts.length; i++) {
var x = parts[i].split('=');
opts[unesc(x[0])] = unesc(x[1]);
}
return opts;
})();
var originalLog = console.log;
console.log = function (msg) {
var index = 1;
var args = arguments;
if (typeof msg === 'string') {
msg = msg.replace(/(^|[^%])%[sd]/g, function (_, s) {
return s + args[index++];
});
}
else msg = inspect(msg);
for (var i = index; i < args.length; i++) {
msg += ' ' + inspect(args[i]);
}
if (params.show === undefined || parseBoolean(params.show)) {
var elem = document.getElementById('__testling_output');
if (elem) {
var txt = document.createTextNode(msg + '\n');
elem.appendChild(txt);
}
}
process.stdout.write(msg + '\n');
if (typeof originalLog === 'function') {
return originalLog.apply(this, arguments);
}
else if (originalLog) return originalLog(arguments[0]);
};
window.__testlingConsole = console;
function parseBoolean (x) {
if (x === 'false' || x === '0') return false;
return true;
}
}).call(this,require("g5I+bs"))
},{"g5I+bs":13,"object-inspect":11,"stream":19,"xhr-write-stream":30}],2:[function(require,module,exports){
;(function () {
var object = typeof exports != 'undefined' ? exports : this; // #8: web workers
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
function InvalidCharacterError(message) {
this.message = message;
}
InvalidCharacterError.prototype = new Error;
InvalidCharacterError.prototype.name = 'InvalidCharacterError';
// encoder
// [https://gist.github.com/999166] by [https://github.com/nignag]
object.btoa || (
object.btoa = function (input) {
for (
// initialize result and counter
var block, charCode, idx = 0, map = chars, output = '';
// if the next input index does not exist:
// change the mapping table to "="
// check if d has no fractional digits
input.charAt(idx | 0) || (map = '=', idx % 1);
// "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
output += map.charAt(63 & block >> 8 - idx % 1 * 8)
) {
charCode = input.charCodeAt(idx += 3/4);
if (charCode > 0xFF) {
throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
}
block = block << 8 | charCode;
}
return output;
});
// decoder
// [https://gist.github.com/1020396] by [https://github.com/atk]
object.atob || (
object.atob = function (input) {
input = input.replace(/=+$/, '');
if (input.length % 4 == 1) {
throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");
}
for (
// initialize result and counters
var bc = 0, bs, buffer, idx = 0, output = '';
// get next character
buffer = input.charAt(idx++);
// character found in table? initialize bit storage and add its ascii value;
~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
// and if not first of each 4 characters,
// convert the first 8 bits to one ascii character
bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
) {
// try to find character in table (0-63, not found => -1)
buffer = chars.indexOf(buffer);
}
return output;
});
}());
},{}],3:[function(require,module,exports){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var base64 = require('base64-js')
var ieee754 = require('ieee754')
exports.Buffer = Buffer
exports.SlowBuffer = Buffer
exports.INSPECT_MAX_BYTES = 50
Buffer.poolSize = 8192
/**
* If `Buffer._useTypedArrays`:
* === true Use Uint8Array implementation (fastest)
* === false Use Object implementation (compatible down to IE6)
*/
Buffer._useTypedArrays = (function () {
// Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+,
// Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding
// properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support
// because we need to be able to add all the node Buffer API methods. This is an issue
// in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438
try {
var buf = new ArrayBuffer(0)
var arr = new Uint8Array(buf)
arr.foo = function () { return 42 }
return 42 === arr.foo() &&
typeof arr.subarray === 'function' // Chrome 9-10 lack `subarray`
} catch (e) {
return false
}
})()
/**
* Class: Buffer
* =============
*
* The Buffer constructor returns instances of `Uint8Array` that are augmented
* with function properties for all the node `Buffer` API functions. We use
* `Uint8Array` so that square bracket notation works as expected -- it returns
* a single octet.
*
* By augmenting the instances, we can avoid modifying the `Uint8Array`
* prototype.
*/
function Buffer (subject, encoding, noZero) {
if (!(this instanceof Buffer))
return new Buffer(subject, encoding, noZero)
var type = typeof subject
// Workaround: node's base64 implementation allows for non-padded strings
// while base64-js does not.
if (encoding === 'base64' && type === 'st