mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-11-14 01:49:41 +01:00
22 lines
449 B
Go
22 lines
449 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func Test_PatchingArray_Example1(t *testing.T) {
|
|
assert := assert.New(t)
|
|
assert.Equal(1, minPatches([]int{1, 3}, 6))
|
|
}
|
|
|
|
func Test_PatchingArray_Example2(t *testing.T) {
|
|
assert := assert.New(t)
|
|
assert.Equal(2, minPatches([]int{1, 5, 10}, 20))
|
|
}
|
|
|
|
func Test_PatchingArray_Example3(t *testing.T) {
|
|
assert := assert.New(t)
|
|
assert.Equal(0, minPatches([]int{1, 2, 2}, 5))
|
|
}
|