mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-11-14 09:59:41 +01:00
23 lines
449 B
Go
23 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))
|
||
|
}
|