mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-07 14:12:28 +08:00
refactor: rewrite all unit test functions with assert
This commit is contained in:
@@ -13,7 +13,7 @@ func TestBase64StdEncode(t *testing.T) {
|
||||
|
||||
func TestBase64StdDecode(t *testing.T) {
|
||||
assert := internal.NewAssert(t, "TestBase64StdDecode")
|
||||
assert.Equal("hello world", Base64StdEncode("aGVsbG8gd29ybGQ="))
|
||||
assert.Equal("hello world", Base64StdDecode("aGVsbG8gd29ybGQ="))
|
||||
}
|
||||
|
||||
func TestMd5String(t *testing.T) {
|
||||
|
||||
@@ -47,9 +47,9 @@ func TestIsDir(t *testing.T) {
|
||||
|
||||
func TestRemoveFile(t *testing.T) {
|
||||
assert := internal.NewAssert(t, "TestRemoveFile")
|
||||
|
||||
f := "./text.txt"
|
||||
if CreateFile(f) {
|
||||
if !IsExist(f) {
|
||||
CreateFile(f)
|
||||
err := RemoveFile(f)
|
||||
assert.IsNil(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user