Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / istanbul / node_modules / wordwrap / test / break.js
1 var test = require('tape');
2 var wordwrap = require('../');
3
4 test('hard', function (t) {
5     var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,'
6         + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",'
7         + '"browser":"chrome/6.0"}'
8     ;
9     var s_ = wordwrap.hard(80)(s);
10     
11     var lines = s_.split('\n');
12     t.equal(lines.length, 2);
13     t.ok(lines[0].length < 80);
14     t.ok(lines[1].length < 80);
15     
16     t.equal(s, s_.replace(/\n/g, ''));
17     t.end();
18 });
19
20 test('break', function (t) {
21     var s = new Array(55+1).join('a');
22     var s_ = wordwrap.hard(20)(s);
23     
24     var lines = s_.split('\n');
25     t.equal(lines.length, 3);
26     t.ok(lines[0].length === 20);
27     t.ok(lines[1].length === 20);
28     t.ok(lines[2].length === 15);
29     
30     t.equal(s, s_.replace(/\n/g, ''));
31     t.end();
32 });