var test = require('tape');
var path = require('path');
var along = require('@turf/along');
var load = require('load-json-file');
var lineSliceAlong = require('.');

var line1 = load.sync(path.join(__dirname, 'test', 'fixtures', 'line1.geojson'));
var route1 = load.sync(path.join(__dirname, 'test', 'fixtures', 'route1.geojson'));
var route2 = load.sync(path.join(__dirname, 'test', 'fixtures', 'route2.geojson'));

test('turf-line-slice -- line1', function (t) {
    var start = 500;
    var stop = 750;
    var units = 'miles';

    var start_point = along(line1, start, units);
    var end_point = along(line1, stop, units);
    var sliced = lineSliceAlong(line1, start, stop, units);
    t.equal(sliced.type, 'Feature');
    t.equal(sliced.geometry.type, 'LineString');
    t.deepEqual(sliced.geometry.coordinates[0], start_point.geometry.coordinates);
    t.deepEqual(sliced.geometry.coordinates[sliced.geometry.coordinates.length - 1], end_point.geometry.coordinates);
    t.end();
});

test('turf-line-slice -- line1 overshoot', function (t) {
		var start = 500;
		var stop = 1500;
	  var units = 'miles';

		var start_point = along(line1, start, units);
		var end_point = along(line1, stop, units);
		var sliced = lineSliceAlong(line1, start, stop, units);
		t.equal(sliced.type, 'Feature');
		t.equal(sliced.geometry.type, 'LineString');
		t.deepEqual(sliced.geometry.coordinates[0], start_point.geometry.coordinates);
		t.deepEqual(sliced.geometry.coordinates[sliced.geometry.coordinates.length - 1], end_point.geometry.coordinates);
		t.end();
});

test('turf-line-slice-along -- route1', function (t) {
    var start = 500;
    var stop = 750;
    var units = 'miles';

    var start_point = along(route1, start, units);
    var end_point = along(route1, stop, units);
    var sliced = lineSliceAlong(route1, start, stop, units);
    t.equal(sliced.type, 'Feature');
    t.equal(sliced.geometry.type, 'LineString');
    t.deepEqual(sliced.geometry.coordinates[0], start_point.geometry.coordinates);
    t.deepEqual(sliced.geometry.coordinates[sliced.geometry.coordinates.length - 1], end_point.geometry.coordinates);
    t.end();
});

test('turf-line-slice-along -- route2', function (t) {
    var start = 25;
    var stop = 50;
    var units = 'miles';

    var start_point = along(route2, start, units);
    var end_point = along(route2, stop, units);
    var sliced = lineSliceAlong(route2, start, stop, units);
    t.equal(sliced.type, 'Feature');
    t.equal(sliced.geometry.type, 'LineString');
    t.deepEqual(sliced.geometry.coordinates[0], start_point.geometry.coordinates);
    t.deepEqual(sliced.geometry.coordinates[sliced.geometry.coordinates.length - 1], end_point.geometry.coordinates);
    t.end();
});

@@ -1045,18 +1045,20 @@
 n (t) %7B%0A
-%09%09
+    
 var star
@@ -1066,18 +1066,20 @@
  = 500;%0A
-%09%09
+    
 var stop
@@ -1087,17 +1087,18 @@
 = 1500;%0A
-%09
+  
   var un
@@ -1113,18 +1113,20 @@
 iles';%0A%0A
-%09%09
+    
 var star
@@ -1159,26 +1159,28 @@
 rt, units);%0A
-%09%09
+    
 var end_poin
@@ -1210,18 +1210,20 @@
 units);%0A
-%09%09
+    
 var slic
@@ -1270,18 +1270,20 @@
 units);%0A
-%09%09
+    
 t.equal(
@@ -1307,18 +1307,20 @@
 ture');%0A
-%09%09
+    
 t.equal(
@@ -1356,18 +1356,20 @@
 ring');%0A
-%09%09
+    
 t.deepEq
@@ -1439,18 +1439,20 @@
 nates);%0A
-%09%09
+    
 t.deepEq
@@ -1561,10 +1561,12 @@
 s);%0A
-%09%09
+    
 t.en

Convert tabs to spaces