Initial commit
[yaffs-website] / node_modules / js-base64 / test / es5.js
1 /*
2  * $Id: es5.js,v 0.1 2012/08/23 19:43:17 dankogai Exp dankogai $
3  *
4  * use mocha to test me
5  * http://visionmedia.github.com/mocha/
6  */
7 var assert, Base64;
8 if (this['window'] !== this) {
9     assert = require("assert");
10     Base64 = require('../base64.js').Base64;
11 }
12 var is = function (a, e, m) {
13     return function () {
14         assert.equal(a, e, m)
15     }
16 };
17
18 if ('extendString' in Base64){
19     Base64.extendString();
20     describe('String', function () {
21         it('.toBase64', is('小飼弾'.toBase64(), '5bCP6aO85by+'));
22         it('.toBase64', is('小飼弾'.toBase64(true), '5bCP6aO85by-'));
23         it('.toBase64URI', is('小飼弾'.toBase64URI(), '5bCP6aO85by-'));
24         it('.fromBase64', is('5bCP6aO85by+'.fromBase64(), '小飼弾'));
25         it('.fromBase64', is('5bCP6aO85by-'.fromBase64(), '小飼弾'));
26     });
27 }