feat: monday
This commit is contained in:
31
pkg/trapping_rain_water/main_test.go
Normal file
31
pkg/trapping_rain_water/main_test.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package trapping_rain_water
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestTrap_Example1(t *testing.T) {
|
||||
height := []int{0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1}
|
||||
expected := 6
|
||||
result := Trap(height)
|
||||
|
||||
assert.Equal(t, expected, result)
|
||||
}
|
||||
|
||||
func TestTrap_Example2(t *testing.T) {
|
||||
height := []int{4, 2, 0, 3, 2, 5}
|
||||
expected := 9
|
||||
result := Trap(height)
|
||||
|
||||
assert.Equal(t, expected, result)
|
||||
}
|
||||
|
||||
func TestTrap_Example3(t *testing.T) {
|
||||
height := []int{0}
|
||||
expected := 0
|
||||
result := Trap(height)
|
||||
|
||||
assert.Equal(t, expected, result)
|
||||
}
|
||||
Reference in New Issue
Block a user