mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
UT: Initial check in unit tests for amount.js.
This commit is contained in:
@@ -12,7 +12,7 @@ var UInt160 = function () {
|
|||||||
// XXX Should standardize on 'i' format or 20 format.
|
// XXX Should standardize on 'i' format or 20 format.
|
||||||
};
|
};
|
||||||
|
|
||||||
UInt160.prototype.from_json = function (j) {
|
UInt160.from_json = function (j) {
|
||||||
var u = new UInt160();
|
var u = new UInt160();
|
||||||
|
|
||||||
return u.parse_json(j);
|
return u.parse_json(j);
|
||||||
|
|||||||
13
test/amount-test.js
Normal file
13
test/amount-test.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
var buster = require("buster");
|
||||||
|
|
||||||
|
var amount = require("../js/amount.js");
|
||||||
|
|
||||||
|
buster.testCase("Amount", {
|
||||||
|
"UInt160" : {
|
||||||
|
"Parse 0" : function () {
|
||||||
|
buster.assert.equals(0, amount.UInt160.from_json("0").value);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// vim:sw=2:sts=2:ts=8
|
||||||
Reference in New Issue
Block a user