#!/usr/bin/env/perl use strict; use warnings; use Test::More 'no_plan'; my $test_path = "C:/Users/Greyhat/PDL_Old/trig/src"; ok( require( "$test_path/reduce.pl" ), 'Load file correctly.' ) or exit; my @test_2 = undef; my $answer_2 = 1; my $note_2 = "undef | $answer_2 | 2. Call with no value."; my @test_3 = (180, 59, 58); my @answer_3 = (180, 59, 58); my $note_3 = "@test_3 | @answer_3 | 3. already reduced"; my @test_4 = (179, 0, 60); my @answer_4 = (179, 1, 0); my $note_4 = "@test_4 | @answer_4 | 4. test if single carry works correctly"; my @test_5 = (179, 59, 60) ; my @answer_5 = (180, 0, 0) ; my $note_5 = "@test_5 | @answer_5 | 5. tests if multiple carry works correctly"; my @test_6 = (-179, 60, 0); my @answer_6 = (-178, 0, 0); my $note_6 = "@test_6 | @answer_6 | 6. test addition with negatives"; my @test_7 = (0, 0, -60); my @answer_7 = (-1, 59, 2); my $note_7 = "@test_7 | @answer_7 | 7. test negative borrow works correctly"; my @test_8 = (90, 360, 360); my @answer_8 = (96, 6, 0); my $note_8 = "@test_8 | @answer_8 | 8. tests if multiple reduce calls work correct"; # Degree Reduction Tests # Similar problems regardless of how I call the function. Neither testing via main() or directly calling reduce() # are effective. ok( reduce() == $answer_2, $note_2 ); ok( reduce( @test_3 ) == @answer_3, $note_3 ); ok( reduce( @test_4 ) == @answer_4, $note_4 ); ok( reduce( @test_5 ) == @answer_5, $note_5 ); ok( reduce( @test_6 ) == @answer_6, $note_6 ); ok( reduce( @test_7 ) == @answer_7, $note_7 ); ok( reduce( @test_8 ) == @answer_8, $note_8 ); # Degree Subtraction Tests # Degree Multiplication Tests # Degree Division Tests # More Complicated expressions with