import {markWord} from '..';

describe('markWord', () => {
    test('returns a function', () => {
        expect(typeof markWord()).toBe('function');
    });

    test('empty', () => {
        expect(markWord()([[{}], []])).toEqual([[[]], []]);
    });

    test('value', () => {
        expect(markWord('A')([
            [[[{value: ''}]]], // oldLinesOfPaths
            [[[{value: ''}]]], // newLinesOfPaths
        ])).toEqual([[[[{value: ''}]]], [[[{value: ''}]]]]);
    });

    test('hit', () => {
        expect(markWord('A')([
            [[[{value: 'A'}]]], // oldLinesOfPaths
            [[[{value: 'A'}]]], // newLinesOfPaths
        ])).toEqual([
            [[[{markType: undefined, type: 'mark', value: 'A'}]]],
            [[[{markType: undefined, type: 'mark', value: 'A'}]]],
        ]);
    });
});

@@ -257,16 +257,20 @@
   test('
+hit 
 value', 
@@ -312,233 +312,8 @@
 )(%5B%0A
-            %5B%5B%5B%7Bvalue: ''%7D%5D%5D%5D, // oldLinesOfPaths%0A            %5B%5B%5B%7Bvalue: ''%7D%5D%5D%5D, // newLinesOfPaths%0A        %5D)).toEqual(%5B%5B%5B%5B%7Bvalue: ''%7D%5D%5D%5D, %5B%5B%5B%7Bvalue: ''%7D%5D%5D%5D%5D);%0A    %7D);%0A%0A    test('hit', () =%3E %7B%0A        expect(markWord('A')(%5B%0A
     
@@ -558,32 +558,32 @@
 value: 'A'%7D%5D%5D%5D,%0A
-
         %5D);%0A    
@@ -585,13 +585,978 @@
 %0A    %7D);
+%0A%0A    test('mark single word', () =%3E %7B%0A        expect(markWord('A', 'first', 'a')(%5B%0A            %5B%5B%5B%7Bvalue: 'AAaabb'%7D%5D%5D%5D, // oldLinesOfPaths%0A            %5B%5B%5B%7Bvalue: ''%7D%5D%5D%5D, // newLinesOfPaths%0A        %5D)).toEqual(%5B%5B%5B%5B%7B%0A            markType: 'first',%0A            type: 'mark',%0A            value: 'a',%0A        %7D%5D, %5B%7B%0A            markType: 'first',%0A            type: 'mark',%0A            value: 'a',%0A        %7D%5D, %5B%7B%0A            value: 'aabb',%0A        %7D%5D%5D%5D, %5B%5B%5B%7Bvalue: ''%7D%5D%5D%5D%5D);%0A    %7D);%0A%0A    test('mark complex word', () =%3E %7B%0A        expect(markWord('%5Ct', 'tab', '    ')(%5B%0A            %5B%5B%5B%7Bvalue: '%5Ct%5Ct    bb'%7D%5D%5D%5D, // oldLinesOfPaths%0A            %5B%5B%5B%7Bvalue: ''%7D%5D%5D%5D, // newLinesOfPaths%0A        %5D)).toEqual(%5B%5B%5B%5B%7B%0A            markType: 'tab',%0A            type: 'mark',%0A            value: '    ',%0A        %7D%5D, %5B%7B%0A            markType: 'tab',%0A            type: 'mark',%0A            value: '    ',%0A        %7D%5D, %5B%7B%0A            value: '    bb',%0A        %7D%5D%5D%5D, %5B%5B%5B%7Bvalue: ''%7D%5D%5D%5D%5D);%0A    %7D);
 %0A%7D);%0A

add basic markWord testcase