DSA/algorithms/Go/arrays/maximum_subarray_sum_test.go

12 lines
247 B
Go
Raw Normal View History

2021-05-07 22:47:50 +00:00
package arrays
import "testing"
func TestMaximumSubarraySum(t *testing.T) {
sampleArray := []int{-2, 1, -3, 4, -1, 2, 1, -5, 4}
want := 6
if got := maximumSubarraySum(sampleArray); want != got {
t.Errorf("want %v , got %v", want, got)
}
}