const VERBOSE = false;

var diff = require('../diff');

function log() {
  VERBOSE && console.log.apply(console, arguments);
}

describe('#structuredPatch', function() {
  it('should handle files with the last line changed', function() {
    var res = diff.structuredPatch(
      'oldfile', 'newfile', 
      'line2\nline3\nline5\n', 'line2\nline3\nline4\nline5\n', 
      'header1', 'header2'
    );
    res.should.eql({
      oldFileName: 'oldfile', newFileName: 'newfile', 
      oldHeader: 'header1', newHeader: 'header2',
      hunks: [{ 
        oldStart: 1, oldLines: 3, newStart: 1, newLines: 4,
        lines: [' line2', ' line3', '+line4', ' line5'],
        oldEOFNewline: true, newEOFNewline: true,
      }]
    });
  });
});

const VERBOSE = false;

var diff = require('../diff');

function log() {
  VERBOSE && console.log.apply(console, arguments);
}

describe('#structuredPatch', function() {
  it('should handle files with the last line changed', function() {
    var res = diff.structuredPatch(
      'oldfile', 'newfile', 
      'line2\nline3\nline4\n', 'line2\nline3\nline5', 
      'header1', 'header2'
    );
    res.should.eql({
      oldFileName: 'oldfile', newFileName: 'newfile', 
      oldHeader: 'header1', newHeader: 'header2',
      hunks: [{ 
        oldStart: 1, oldLines: 3, newStart: 1, newLines: 3,
        lines: [' line2', ' line3', '-line4', '+line5', '\\ No newline at end of file'],
      }]
    });
  });
});

Test on structured patch method updated
Test on structured patch method updated
