es6.js 774 B

12345678910111213141516171819202122232425
  1. /*
  2. * $Id: es6.js,v 0.1 2017/11/29 21:43:17 ufolux Exp ufolux $
  3. *
  4. * use mocha to test me
  5. * http://visionmedia.github.com/mocha/
  6. */
  7. import {Base64} from '../base64'
  8. var assert = assert || require("assert");
  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. }