Created
October 25, 2016 22:01
-
-
Save herince/dc59b87743801e5d67aa1a10a9b2ca56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "testing" | |
func testSquareSumDiff(n uint64, expected uint64, t *testing.T) { | |
result := SquareSumDifference(n) | |
if result != expected { | |
t.Error("Expected ", expected, ", got ", result) | |
} | |
} | |
func TestWithExample(t *testing.T) { | |
testSquareSumDiff(10, 2640, t) | |
} | |
func TestWithZero(t *testing.T) { | |
testSquareSumDiff(0, 0, t) | |
} | |
func TestWithSomeReallyBigNumber(t *testing.T) { | |
testSquareSumDiff(100, 25164150, t) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment