mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
UT: split out utils test.
This commit is contained in:
committed by
Stefan Thomas
parent
1af8c6f7d4
commit
7c802e501b
26
test/utils-test.js
Normal file
26
test/utils-test.js
Normal file
@@ -0,0 +1,26 @@
|
||||
var fs = require("fs");
|
||||
var buster = require("buster");
|
||||
|
||||
var utils = require("../js/utils.js");
|
||||
|
||||
buster.testCase("Utils", {
|
||||
"hexToString and stringToHex" : {
|
||||
"Even: 123456" : function () {
|
||||
buster.assert.equals("123456", utils.stringToHex(utils.hexToString("123456")));
|
||||
},
|
||||
"Odd: 12345" : function () {
|
||||
buster.assert.equals("012345", utils.stringToHex(utils.hexToString("12345")));
|
||||
},
|
||||
"Under 10: 0" : function () {
|
||||
buster.assert.equals("00", utils.stringToHex(utils.hexToString("0")));
|
||||
},
|
||||
"Under 10: 1" : function () {
|
||||
buster.assert.equals("01", utils.stringToHex(utils.hexToString("1")));
|
||||
},
|
||||
"Empty" : function () {
|
||||
buster.assert.equals("", utils.stringToHex(utils.hexToString("")));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// vim:sw=2:sts=2:ts=8
|
||||
Reference in New Issue
Block a user