Skip to content

Commit

Permalink
refactor unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jt-l committed Mar 10, 2020
1 parent c26e06b commit 4f8172d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
23 changes: 23 additions & 0 deletions internal/horologa/gcd_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package horologa

import "testing"

func TestGcd(t *testing.T) {
var expectedResult int = 10

result := gcd(10, 10)

if result != expectedResult {
t.Fatalf("Expected %d but got %d", result, expectedResult)
}
}

func TestGcdOne(t *testing.T) {
var expectedResult int = 1

result := gcd(7, 9)

if result != expectedResult {
t.Fatalf("Expected %d but got %d", result, expectedResult)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,6 @@ package horologa

import "testing"

func TestGcd(t *testing.T) {
var expectedResult int = 10

result := gcd(10, 10)

if result != expectedResult {
t.Fatalf("Expected %d but got %d", result, expectedResult)
}
}

func TestGcdOne(t *testing.T) {
var expectedResult int = 1

result := gcd(7, 9)

if result != expectedResult {
t.Fatalf("Expected %d but got %d", result, expectedResult)
}
}

func TestLcmSame(t *testing.T) {
var expectedResult int = 10

Expand Down

0 comments on commit 4f8172d

Please sign in to comment.