阶段十:完成 Go 基础包注释基线清零
This commit is contained in:
1 parent
ea1f2ec430
commit
d1a165f897
14 files changed
+135
-924
No files matched your search
@@ -2,12 +2,15 @@ package version
|
||||
|
||||
import "testing"
|
||||
|
||||
// TestShortCommit 负责TestShortCommit相关处理。
|
||||
func TestShortCommit(t *testing.T) {
|
||||
// original 保存original,供当前处理流程使用
|
||||
original := Commit
|
||||
t.Cleanup(func() { Commit = original })
|
||||
|
||||
Commit = "0123456789abcdef"
|
||||
if got := ShortCommit(); got != "0123456789ab" {
|
||||
if // got 保存got,供当前处理流程使用
|
||||
got := ShortCommit(); got != "0123456789ab" {
|
||||
t.Fatalf("ShortCommit() = %q", got)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user