rm util unti test

This commit is contained in:
Tankred Hase 2013-05-23 14:04:44 +02:00
parent c8094de448
commit 52fba1a462
2 changed files with 0 additions and 49 deletions

View File

@ -53,7 +53,6 @@
<!-- tests -->
<script src="../test-data.js"></script>
<script src="util-test.js"></script>
<script src="forge-test.js"></script>
<script src="aes-test.js"></script>
<script src="rsa-test.js"></script>

View File

@ -1,48 +0,0 @@
module("Util");
test("JQuery and basic requirements", 7, function() {
ok(Array.prototype.push, "Array.push()");
ok(Function.prototype.apply, "Function.apply()");
ok(document.getElementById, "getElementById");
ok(document.getElementsByTagName, "getElementsByTagName");
ok(RegExp, "RegExp");
ok(jQuery, "jQuery");
ok($, "$");
});
test("UUID", 2, function() {
var util = new cryptoLib.Util(window, uuid);
var id = util.UUID();
ok(id, "UUID: " + id);
ok(id.length === 36, "UUID length");
});
test("random", 3, function() {
var util = new cryptoLib.Util(window, uuid);
var base64 = util.random(128);
var str = window.atob(base64);
ok(base64, "Random base64: " + base64);
ok(str, "Random binary string: " + str);
ok(str.length === 16, "Random length");
});
test("Parse Date", 1, function() {
var util = new cryptoLib.Util(window, uuid);
var str = '1900-01-31 18:17:53';
var date = util.parseDate(str);
var formated = util.formatDate(date);
equal(formated, str, "Date: " + date);
});
test("String -> Uint8Array -> String", 3, function() {
var util = new cryptoLib.Util(window);
var input = "asdf";
var buf = util.binStr2Uint8Arr(input);
ok(buf);
// test slow conversion in js
var binStr = util.uint8Arr2BinStr(buf);
ok(binStr);
equal(binStr, input);
});