'use strict';

// MODULES //

var test = require( 'tape' );
var abs = require( 'math-abs' );
<<<<<<< HEAD
var cos = require( './../lib' );
=======
var sin = require( './../lib' );
>>>>>>> origin/master


// TESTS //

test( 'main export is a function', function test( t ) {
<<<<<<< HEAD
	t.ok( typeof cos === 'function', 'main export is a function' );
	t.end();
});

test( 'the function computes the cosine', function test( t ) {
	var delta;

	delta = abs( cos( 0 ) - 1 );
	t.ok( delta < 1e-14, 'approx 0' );

	delta = abs( cos( Math.PI/2 ) - 0 );
	t.ok( delta < 1e-14, 'approx 0' );

	delta = abs( cos( Math.PI/3 ) - 0.5 );
	t.ok( delta < 1e-14, 'approx 1/2' );

	delta = abs( cos( Math.PI/4 ) - Math.sqrt(2)/2 );
	t.ok( delta < 1e-14, 'approx 1/2' );
=======
	t.ok( typeof sin === 'function', 'main export is a function' );
	t.end();
});

test( 'the function computes the sine', function test( t ) {
	var delta;

	delta = abs( sin( 0 ) - 0 );
	t.ok( delta < 1e-14, 'approx 0' );

	delta = abs( sin( Math.PI ) - 0 );
	t.ok( delta < 1e-14, 'approx 0' );

	delta = abs( sin( Math.PI/6 ) - 0.5 );
	t.ok( delta < 1e-14, 'approx 1/2' );

	delta = abs( sin( -Math.PI/6 ) + 0.5 );
	t.ok( delta < 1e-14, 'approx -1/2' );

	delta = abs( sin( Math.PI/2 ) - 1 );
	t.ok( delta < 1e-14, 'approx 1' );

	delta = abs( sin( -Math.PI/2 ) + 1 );
	t.ok( delta < 1e-14, 'approx -1' );
>>>>>>> origin/master

	t.end();
});

test( 'the function returns `NaN` if provided a `NaN`', function test( t ) {
<<<<<<< HEAD
	var v = cos( NaN );
=======
	var v = sin( NaN );
>>>>>>> origin/master
	t.ok( v !== v, 'returns NaN' );
	t.end();
});

test( 'the function returns `NaN` if provided a `+infinity`', function test( t ) {
<<<<<<< HEAD
	var v = cos( Number.POSITIVE_INFINITY );
=======
	var v = sin( Number.POSITIVE_INFINITY );
>>>>>>> origin/master
	t.ok( v !== v, 'returns NaN' );
	t.end();
});

test( 'the function returns `NaN` if provided a `-infinity`', function test( t ) {
<<<<<<< HEAD
	var v = cos( Number.NEGATIVE_INFINITY );
=======
	var v = sin( Number.NEGATIVE_INFINITY );
>>>>>>> origin/master
	t.ok( v !== v, 'returns NaN' );
	t.end();
});

@@ -86,29 +86,16 @@
 abs' );%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A
 var cos 
@@ -123,71 +123,8 @@
  );%0A
-=======%0Avar sin = require( './../lib' );%0A%3E%3E%3E%3E%3E%3E%3E origin/master%0A
 %0A%0A//
@@ -190,29 +190,16 @@
 ( t ) %7B%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A
 %09t.ok( t
@@ -660,659 +660,15 @@
  );%0A
-=======%0A%09t.ok( typeof sin === 'function', 'main export is a function' );%0A%09t.end();%0A%7D);%0A%0Atest( 'the function computes the sine', function test( t ) %7B%0A%09var delta;%0A%0A%09delta = abs( sin( 0 ) - 0 );%0A%09t.ok( delta %3C 1e-14, 'approx 0' );%0A%0A%09delta = abs( sin( Math.PI ) - 0 );%0A%09t.ok( delta %3C 1e-14, 'approx 0' );%0A%0A%09delta = abs( sin( Math.PI/6 ) - 0.5 );%0A%09t.ok( delta %3C 1e-14, 'approx 1/2' );%0A%0A%09delta = abs( sin( -Math.PI/6 ) + 0.5 );%0A%09t.ok( delta %3C 1e-14, 'approx -1/2' );%0A%0A%09delta = abs( sin( Math.PI/2 ) - 1 );%0A%09t.ok( delta %3C 1e-14, 'approx 1' );%0A%0A%09delta = abs( sin( -Math.PI/2 ) + 1 );%0A%09t.ok( delta %3C 1e-14, 'approx -1' );%0A%3E%3E%3E%3E%3E%3E%3E origin/master%0A%0A%09t.end();
 %0A%7D);%0A%0A
+%0A
 test
@@ -736,37 +736,24 @@
 test( t ) %7B%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A
 %09var v = cos
@@ -765,59 +765,8 @@
  );%0A
-=======%0A%09var v = sin( NaN );%0A%3E%3E%3E%3E%3E%3E%3E origin/master%0A
 %09t.o
@@ -888,37 +888,24 @@
 test( t ) %7B%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A
 %09var v = cos
@@ -938,80 +938,8 @@
  );%0A
-=======%0A%09var v = sin( Number.POSITIVE_INFINITY );%0A%3E%3E%3E%3E%3E%3E%3E origin/master%0A
 %09t.o

Fix test.js