mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-01-23 21:32:19 +08:00
搭建框架
This commit is contained in:
13
vendor/github.com/huichen/wukong/utils/test_utils.go
generated
vendored
Normal file
13
vendor/github.com/huichen/wukong/utils/test_utils.go
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Expect(t *testing.T, expect string, actual interface{}) {
|
||||
actualString := fmt.Sprint(actual)
|
||||
if expect != actualString {
|
||||
t.Errorf("期待值=\"%s\", 实际=\"%s\"", expect, actualString)
|
||||
}
|
||||
}
|
||||
15
vendor/github.com/huichen/wukong/utils/utils.go
generated
vendored
Normal file
15
vendor/github.com/huichen/wukong/utils/utils.go
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package utils
|
||||
|
||||
func AbsInt(a int) int {
|
||||
if a < 0 {
|
||||
return -a
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
||||
func MinInt(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
Reference in New Issue
Block a user