mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
d9b422cfbc
a0cfa3c version upgrade e58e2f5 jsonrpc.js tests && jsonrpc response validation is more strict 45134de jsonrpc.js file && batch polling f3ce1f0 simplified polling && jsonrpc payload creation ddc1719 tests && fixes for utils methods fdcc1af clearing tests 4a54b8c version upgrade 0.0.12 git-subtree-dir: libjsqrc/ethereumjs git-subtree-split: a0cfa3ca21163f26f3f71a0e2ce0a1e617554c72
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
var assert = require('assert');
|
|
var utils = require('../lib/utils.js');
|
|
|
|
describe('utils', function () {
|
|
describe('extractDisplayName', function () {
|
|
it('should extract display name from method with no params', function () {
|
|
|
|
// given
|
|
var test = 'helloworld()';
|
|
|
|
// when
|
|
var displayName = utils.extractDisplayName(test);
|
|
|
|
// then
|
|
assert.equal(displayName, 'helloworld');
|
|
});
|
|
|
|
it('should extract display name from method with one param' , function () {
|
|
|
|
// given
|
|
var test = 'helloworld1(int)';
|
|
|
|
// when
|
|
var displayName = utils.extractDisplayName(test);
|
|
|
|
// then
|
|
assert.equal(displayName, 'helloworld1');
|
|
});
|
|
|
|
it('should extract display name from method with two params' , function () {
|
|
|
|
// given
|
|
var test = 'helloworld2(int,string)';
|
|
|
|
// when
|
|
var displayName = utils.extractDisplayName(test);
|
|
|
|
// then
|
|
assert.equal(displayName, 'helloworld2');
|
|
});
|
|
});
|
|
});
|