Skip to content

Instantly share code, notes, and snippets.

@herince
Created October 25, 2016 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herince/dc59b87743801e5d67aa1a10a9b2ca56 to your computer and use it in GitHub Desktop.
Save herince/dc59b87743801e5d67aa1a10a9b2ca56 to your computer and use it in GitHub Desktop.
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