es5.js 799 B

123456789101112131415161718192021222324
  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 = assert || require("assert");
  8. var Base64 = Base64 || require('../base64.js').Base64;
  9. var is = function (a, e, m) {
  10. return function () {
  11. assert.equal(a, e, m)
  12. }
  13. };
  14. if ('extendString' in Base64){
  15. Base64.extendString();
  16. describe('String', function () {
  17. it('.toBase64', is('小飼弾'.toBase64(), '5bCP6aO85by+'));
  18. it('.toBase64', is('小飼弾'.toBase64(true), '5bCP6aO85by-'));
  19. it('.toBase64URI', is('小飼弾'.toBase64URI(), '5bCP6aO85by-'));
  20. it('.fromBase64', is('5bCP6aO85by+'.fromBase64(), '小飼弾'));
  21. it('.fromBase64', is('5bCP6aO85by-'.fromBase64(), '小飼弾'));
  22. });
  23. }