-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
16 lines (15 loc) · 705 Bytes
/
Copy pathtest.js
File metadata and controls
16 lines (15 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var stringpad = require("./");
var test = require("tape");
test('stringpad', function(assert) {
assert.plan(10);
assert.strictEqual(stringpad.left('foo', 5), ' foo');
assert.strictEqual(stringpad.left('foobar', 6), 'foobar');
assert.strictEqual(stringpad.left(1, 2, 0), '01');
assert.strictEqual(stringpad.left(1, 2, '-'), '-1');
assert.strictEqual(stringpad.right('foo', 5), 'foo ');
assert.strictEqual(stringpad.right('foobar', 6), 'foobar');
assert.strictEqual(stringpad.right(1, 2, 0), '10');
assert.strictEqual(stringpad.right(1, 2, '-'), '1-');
assert.strictEqual(stringpad.center('foo', 5), ' foo ');
assert.strictEqual(stringpad.center('foo', 6, '-'), '---foo---');
});