atob.js/test.js

21 lines
484 B
JavaScript
Raw Normal View History

2012-09-19 20:22:55 +00:00
/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true eqeqeq:true immed:true latedef:true*/
2011-09-09 04:18:42 +00:00
(function () {
"use strict";
var atob = require('./index')
2011-09-09 20:56:22 +00:00
, encoded = "SGVsbG8gV29ybGQ="
, unencoded = "Hello World"
2012-09-19 20:22:55 +00:00
/*
, encoded = "SGVsbG8sIBZM"
, unencoded = "Hello, 世界"
*/
2011-09-09 04:18:42 +00:00
;
2011-09-09 20:56:22 +00:00
if (unencoded !== atob(encoded)) {
2012-09-19 20:22:55 +00:00
console.log('[FAIL]', unencoded, atob(encoded));
2011-09-09 04:18:42 +00:00
return;
}
console.log('[PASS] all tests pass');
}());