1 /* -*- Mode: js; js-indent-level: 2; -*- */
3 * Copyright 2011 Mozilla Foundation and contributors
4 * Licensed under the New BSD license. See LICENSE or:
5 * http://opensource.org/licenses/BSD-3-Clause
7 define('test/source-map/assert', ['exports'], function (exports) {
9 let do_throw = function (msg) {
13 exports.init = function (throw_fn) {
17 exports.doesNotThrow = function (fn) {
26 exports.equal = function (actual, expected, msg) {
27 msg = msg || String(actual) + ' != ' + String(expected);
28 if (actual != expected) {
33 exports.ok = function (val, msg) {
34 msg = msg || String(val) + ' is falsey';
40 exports.strictEqual = function (actual, expected, msg) {
41 msg = msg || String(actual) + ' !== ' + String(expected);
42 if (actual !== expected) {
47 exports.throws = function (fn) {
50 do_throw('Expected an error to be thrown, but it wasn\'t.');