mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-11 00:02:28 +08:00
refactor: rename package 'utils' to 'internal'
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/duke-git/lancet/utils"
|
||||
"github.com/duke-git/lancet/internal"
|
||||
)
|
||||
|
||||
func TestBase64StdEncode(t *testing.T) {
|
||||
@@ -13,7 +13,7 @@ func TestBase64StdEncode(t *testing.T) {
|
||||
bs := Base64StdEncode(s)
|
||||
|
||||
if bs != "aGVsbG8gd29ybGQ=" {
|
||||
utils.LogFailedTestInfo(t, "Base64StdEncode", s, "aGVsbG8gd29ybGQ=", bs)
|
||||
internal.LogFailedTestInfo(t, "Base64StdEncode", s, "aGVsbG8gd29ybGQ=", bs)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ func TestBase64StdDecode(t *testing.T) {
|
||||
s := Base64StdDecode(bs)
|
||||
|
||||
if s != "hello world" {
|
||||
utils.LogFailedTestInfo(t, "Base64StdDecode", bs, "hello world=", s)
|
||||
internal.LogFailedTestInfo(t, "Base64StdDecode", bs, "hello world=", s)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func TestMd5String(t *testing.T) {
|
||||
expected := "5d41402abc4b2a76b9719d911017c592"
|
||||
|
||||
if smd5 != expected {
|
||||
utils.LogFailedTestInfo(t, "Md5String", s, expected, smd5)
|
||||
internal.LogFailedTestInfo(t, "Md5String", s, expected, smd5)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ func TestHmacMd5(t *testing.T) {
|
||||
expected := "5f4c9faaff0a1ad3007d9ddc06abe36d"
|
||||
|
||||
if hmacMd5 != expected {
|
||||
utils.LogFailedTestInfo(t, "HmacMd5", s, expected, hmacMd5)
|
||||
internal.LogFailedTestInfo(t, "HmacMd5", s, expected, hmacMd5)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ func TestHmacSha1(t *testing.T) {
|
||||
expected := "3826f812255d8683f051ee97346d1359234d5dbd"
|
||||
|
||||
if hmacSha1 != expected {
|
||||
utils.LogFailedTestInfo(t, "HmacSha1", s, expected, hmacSha1)
|
||||
internal.LogFailedTestInfo(t, "HmacSha1", s, expected, hmacSha1)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ func TestHmacSha256(t *testing.T) {
|
||||
expected := "9dce2609f2d67d41f74c7f9efc8ccd44370d41ad2de52982627588dfe7289ab8"
|
||||
|
||||
if hmacSha256 != expected {
|
||||
utils.LogFailedTestInfo(t, "HmacSha256", s, expected, hmacSha256)
|
||||
internal.LogFailedTestInfo(t, "HmacSha256", s, expected, hmacSha256)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ func TestHmacSha512(t *testing.T) {
|
||||
expected := "5b1563ac4e9b49c9ada8ccb232588fc4f0c30fd12f756b3a0b95af4985c236ca60925253bae10ce2c6bf9af1c1679b51e5395ff3d2826c0a2c7c0d72225d4175"
|
||||
|
||||
if hmacSha512 != expected {
|
||||
utils.LogFailedTestInfo(t, "HmacSha512", s, expected, hmacSha512)
|
||||
internal.LogFailedTestInfo(t, "HmacSha512", s, expected, hmacSha512)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ func TestSha1(t *testing.T) {
|
||||
expected := "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"
|
||||
|
||||
if sha1 != expected {
|
||||
utils.LogFailedTestInfo(t, "Sha1", s, expected, sha1)
|
||||
internal.LogFailedTestInfo(t, "Sha1", s, expected, sha1)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ func TestSha256(t *testing.T) {
|
||||
expected := "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"
|
||||
|
||||
if sha256 != expected {
|
||||
utils.LogFailedTestInfo(t, "Sha256", s, expected, sha256)
|
||||
internal.LogFailedTestInfo(t, "Sha256", s, expected, sha256)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ func TestSha512(t *testing.T) {
|
||||
expected := "309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca86d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f"
|
||||
|
||||
if sha512 != expected {
|
||||
utils.LogFailedTestInfo(t, "Sha512", s, expected, sha512)
|
||||
internal.LogFailedTestInfo(t, "Sha512", s, expected, sha512)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user