Skip to content

Commit

Permalink
moving tests into the prime package
Browse files Browse the repository at this point in the history
  • Loading branch information
afshin committed Jul 29, 2015
1 parent a35324a commit 6aa7c76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
File renamed without changes.
11 changes: 4 additions & 7 deletions prime-tests_test.go → prime_test.go
@@ -1,9 +1,6 @@
package prime_test
package prime

import (
"github.com/afshin/prime"
"testing"
)
import "testing"

var firstHundredNonPrimes = [100]uint64{
0, 1, 4, 6, 8, 9, 10, 12, 14, 15,
Expand All @@ -29,14 +26,14 @@ var firstHundredPrimes = [100]uint64{

func TestFirstHundredNonPrimes(t *testing.T) {
for _, candidate := range firstHundredNonPrimes {
if prime.IsPrime(candidate) {
if IsPrime(candidate) {
t.Errorf("%d should not be prime.", candidate)
}
}
}
func TestFirstHundredPrimes(t *testing.T) {
for _, candidate := range firstHundredPrimes {
if !prime.IsPrime(candidate) {
if !IsPrime(candidate) {
t.Errorf("%d should be prime.", candidate)
}
}
Expand Down

0 comments on commit 6aa7c76

Please sign in to comment.