~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tools/node_modules/source-map/test/source-map/test-base64.js

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-09-20 22:44:35 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130920224435-apuwj4fsl3fqv1a6
Tags: 1.5.6~20130920~6010666-1
* New snapshot release
* Update the list of supported architectures to the same as libv8
  (Closes: #723129)
* emlibtool has been removed from upstream.
* Fix warning syntax-error-in-dep5-copyright
* Refresh of the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: js; js-indent-level: 2; -*- */
 
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
 
6
 */
 
7
if (typeof define !== 'function') {
 
8
    var define = require('amdefine')(module);
 
9
}
 
10
define(function (require, exports, module) {
 
11
 
 
12
  var base64 = require('../../lib/source-map/base64');
 
13
 
 
14
  exports['test out of range encoding'] = function (assert, util) {
 
15
    assert.throws(function () {
 
16
      base64.encode(-1);
 
17
    });
 
18
    assert.throws(function () {
 
19
      base64.encode(64);
 
20
    });
 
21
  };
 
22
 
 
23
  exports['test out of range decoding'] = function (assert, util) {
 
24
    assert.throws(function () {
 
25
      base64.decode('=');
 
26
    });
 
27
  };
 
28
 
 
29
  exports['test normal encoding and decoding'] = function (assert, util) {
 
30
    for (var i = 0; i < 64; i++) {
 
31
      assert.equal(base64.decode(base64.encode(i)), i);
 
32
    }
 
33
  };
 
34
 
 
35
});