Skip to content

Commit f78c95e

Browse files
committed
优化
1 parent 35bcd4e commit f78c95e

File tree

118 files changed

+2549
-684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2549
-684
lines changed

bencode/bencode_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func Test_NewDecoder(t *testing.T) {
207207
}
208208

209209
func Test_Marshal(t *testing.T) {
210-
assertError := cryptobin_test.AssertErrorT(t)
210+
assertError := cryptobin_test.AssertNoErrorT(t)
211211
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
212212

213213
buf := map[string]any{
@@ -235,7 +235,7 @@ func Test_MustMarshal(t *testing.T) {
235235
}
236236

237237
func Test_SingleTorrent_Check(t *testing.T) {
238-
errChek := cryptobin_test.AssertErrorT(t)
238+
errChek := cryptobin_test.AssertNoErrorT(t)
239239
assertEqual := cryptobin_test.AssertEqualT(t)
240240
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
241241

@@ -315,7 +315,7 @@ func Test_SingleTorrent_Check(t *testing.T) {
315315
}
316316

317317
func Test_MultipleTorrent_Check(t *testing.T) {
318-
errChek := cryptobin_test.AssertErrorT(t)
318+
errChek := cryptobin_test.AssertNoErrorT(t)
319319
assertEqual := cryptobin_test.AssertEqualT(t)
320320
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
321321

bencode/bytes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
func Test_Bytes(t *testing.T) {
1010
assertEqual := cryptobin_test.AssertEqualT(t)
11-
assertError := cryptobin_test.AssertErrorT(t)
11+
assertError := cryptobin_test.AssertNoErrorT(t)
1212

1313
data := []byte("123123")
1414

bencode/misc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func Test_bytesAsString(t *testing.T) {
1616

1717
func Test_splitPieceHashes(t *testing.T) {
1818
eq := cryptobin_test.AssertEqualT(t)
19-
errChek := cryptobin_test.AssertErrorT(t)
19+
errChek := cryptobin_test.AssertNoErrorT(t)
2020

2121
d := "test--data1234567890data..test0987654321"
2222
res, err := splitPieceHashes(d)

bencode/scanner_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99

1010
func Test_scanner(t *testing.T) {
1111
eq := cryptobin_test.AssertEqualT(t)
12-
errChek := cryptobin_test.AssertErrorT(t)
13-
errChekNil := cryptobin_test.AssertNotErrorNilT(t)
12+
errChek := cryptobin_test.AssertNoErrorT(t)
13+
errChekNil := cryptobin_test.AssertErrorT(t)
1414

1515
d := bytes.NewBufferString("test data")
1616

cipher/des/des_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
func Test_Encrypt(t *testing.T) {
1010
assertEqual := cryptobin_test.AssertEqualT(t)
11-
assertError := cryptobin_test.AssertErrorT(t)
11+
assertError := cryptobin_test.AssertNoErrorT(t)
1212
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
1313

1414
key := "ujikioinsdujfic8"

cryptobin/bign/bign_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func Test_Gen_PKCS1PrivateKey(t *testing.T) {
11-
assertError := cryptobin_test.AssertErrorT(t)
11+
assertError := cryptobin_test.AssertNoErrorT(t)
1212
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
1313

1414
gen := GenerateKey("Bign256v1")
@@ -26,7 +26,7 @@ func Test_Gen_PKCS1PrivateKey(t *testing.T) {
2626
}
2727

2828
func Test_Gen_PKCS8PrivateKey(t *testing.T) {
29-
assertError := cryptobin_test.AssertErrorT(t)
29+
assertError := cryptobin_test.AssertNoErrorT(t)
3030
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
3131

3232
gen := GenerateKey("Bign256v1")
@@ -44,7 +44,7 @@ func Test_Gen_PKCS8PrivateKey(t *testing.T) {
4444
}
4545

4646
func Test_PublickeyXY(t *testing.T) {
47-
assertError := cryptobin_test.AssertErrorT(t)
47+
assertError := cryptobin_test.AssertNoErrorT(t)
4848
assertEqual := cryptobin_test.AssertEqualT(t)
4949
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
5050

@@ -70,7 +70,7 @@ func Test_PublickeyXY(t *testing.T) {
7070
}
7171

7272
func Test_PublickeyXY_2(t *testing.T) {
73-
assertError := cryptobin_test.AssertErrorT(t)
73+
assertError := cryptobin_test.AssertNoErrorT(t)
7474
assertEqual := cryptobin_test.AssertEqualT(t)
7575
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
7676

@@ -96,7 +96,7 @@ func Test_PublickeyXY_2(t *testing.T) {
9696
}
9797

9898
func Test_PublickeyXY_String(t *testing.T) {
99-
assertError := cryptobin_test.AssertErrorT(t)
99+
assertError := cryptobin_test.AssertNoErrorT(t)
100100
assertEqual := cryptobin_test.AssertEqualT(t)
101101
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
102102

@@ -117,7 +117,7 @@ func Test_PublickeyXY_String(t *testing.T) {
117117
}
118118

119119
func Test_PublickeyXY_Bytes(t *testing.T) {
120-
assertError := cryptobin_test.AssertErrorT(t)
120+
assertError := cryptobin_test.AssertNoErrorT(t)
121121
assertEqual := cryptobin_test.AssertEqualT(t)
122122
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
123123

@@ -140,7 +140,7 @@ func Test_PublickeyXY_Bytes(t *testing.T) {
140140
}
141141

142142
func Test_PrivateKeyD(t *testing.T) {
143-
assertError := cryptobin_test.AssertErrorT(t)
143+
assertError := cryptobin_test.AssertNoErrorT(t)
144144
assertEqual := cryptobin_test.AssertEqualT(t)
145145
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
146146

@@ -160,7 +160,7 @@ func Test_PrivateKeyD(t *testing.T) {
160160
}
161161

162162
func Test_PrivateKey_Bytes(t *testing.T) {
163-
assertError := cryptobin_test.AssertErrorT(t)
163+
assertError := cryptobin_test.AssertNoErrorT(t)
164164
assertEqual := cryptobin_test.AssertEqualT(t)
165165
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
166166

@@ -182,7 +182,7 @@ func Test_PrivateKey_Bytes(t *testing.T) {
182182
}
183183

184184
func Test_GetPrivateKeyString(t *testing.T) {
185-
assertError := cryptobin_test.AssertErrorT(t)
185+
assertError := cryptobin_test.AssertNoErrorT(t)
186186
assertEqual := cryptobin_test.AssertEqualT(t)
187187
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
188188

@@ -232,7 +232,7 @@ func Test_CreatePKCS1PrivateKeyWithPassword(t *testing.T) {
232232

233233
func test_CreatePKCS1PrivateKeyWithPassword(t *testing.T, cipher string) {
234234
assertEqual := cryptobin_test.AssertEqualT(t)
235-
assertError := cryptobin_test.AssertErrorT(t)
235+
assertError := cryptobin_test.AssertNoErrorT(t)
236236
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
237237

238238
t.Run(cipher, func(t *testing.T) {
@@ -264,7 +264,7 @@ func test_CreatePKCS1PrivateKeyWithPassword(t *testing.T, cipher string) {
264264
}
265265

266266
func Test_PKCS8PrivateKey_Der(t *testing.T) {
267-
assertError := cryptobin_test.AssertErrorT(t)
267+
assertError := cryptobin_test.AssertNoErrorT(t)
268268
assertEqual := cryptobin_test.AssertEqualT(t)
269269
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
270270

@@ -286,7 +286,7 @@ func Test_PKCS8PrivateKey_Der(t *testing.T) {
286286
}
287287

288288
func Test_PKCS1PrivateKey_Der(t *testing.T) {
289-
assertError := cryptobin_test.AssertErrorT(t)
289+
assertError := cryptobin_test.AssertNoErrorT(t)
290290
assertEqual := cryptobin_test.AssertEqualT(t)
291291
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
292292

@@ -308,7 +308,7 @@ func Test_PKCS1PrivateKey_Der(t *testing.T) {
308308
}
309309

310310
func Test_PublicKey_Der(t *testing.T) {
311-
assertError := cryptobin_test.AssertErrorT(t)
311+
assertError := cryptobin_test.AssertNoErrorT(t)
312312
assertEqual := cryptobin_test.AssertEqualT(t)
313313
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
314314

@@ -366,8 +366,8 @@ func Test_SignWithEncoding(t *testing.T) {
366366

367367
func test_SignWithEncoding(t *testing.T, encoding EncodingType) {
368368
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
369-
assertBool := cryptobin_test.AssertBoolT(t)
370-
assertError := cryptobin_test.AssertErrorT(t)
369+
assertBool := cryptobin_test.AssertTrueT(t)
370+
assertError := cryptobin_test.AssertNoErrorT(t)
371371

372372
gen := GenerateKey("Bign256v1")
373373

@@ -400,7 +400,7 @@ func test_SignWithEncoding(t *testing.T, encoding EncodingType) {
400400
}
401401

402402
func Test_SignWithEncoding_Two_Check(t *testing.T) {
403-
assertError := cryptobin_test.AssertErrorT(t)
403+
assertError := cryptobin_test.AssertNoErrorT(t)
404404
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
405405
assertNotEqual := cryptobin_test.AssertNotEqualT(t)
406406

cryptobin/bign/sign_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ M2Nie29mugemzh6T00lM1bDeD1PqBs8weCpFFv20s62c3CQ=
3232

3333
func Test_SignASN1_And_VerifyASN1(t *testing.T) {
3434
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
35-
assertError := cryptobin_test.AssertErrorT(t)
36-
assertBool := cryptobin_test.AssertBoolT(t)
35+
assertError := cryptobin_test.AssertNoErrorT(t)
36+
assertBool := cryptobin_test.AssertTrueT(t)
3737

3838
data := "test-pass"
3939
adata := []byte{
@@ -67,8 +67,8 @@ func Test_SignASN1_And_VerifyASN1(t *testing.T) {
6767

6868
func Test_Sign(t *testing.T) {
6969
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
70-
assertBool := cryptobin_test.AssertBoolT(t)
71-
assertError := cryptobin_test.AssertErrorT(t)
70+
assertBool := cryptobin_test.AssertTrueT(t)
71+
assertError := cryptobin_test.AssertNoErrorT(t)
7272

7373
data := "test-pass"
7474
adata := []byte{
@@ -100,8 +100,8 @@ func Test_Sign(t *testing.T) {
100100

101101
func Test_SignASN1(t *testing.T) {
102102
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
103-
assertBool := cryptobin_test.AssertBoolT(t)
104-
assertError := cryptobin_test.AssertErrorT(t)
103+
assertBool := cryptobin_test.AssertTrueT(t)
104+
assertError := cryptobin_test.AssertNoErrorT(t)
105105

106106
data := "test-pass"
107107
adata := []byte{
@@ -133,8 +133,8 @@ func Test_SignASN1(t *testing.T) {
133133

134134
func Test_SignBytes(t *testing.T) {
135135
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
136-
assertBool := cryptobin_test.AssertBoolT(t)
137-
assertError := cryptobin_test.AssertErrorT(t)
136+
assertBool := cryptobin_test.AssertTrueT(t)
137+
assertError := cryptobin_test.AssertNoErrorT(t)
138138

139139
data := "test-pass"
140140
adata := []byte{
@@ -165,8 +165,8 @@ func Test_SignBytes(t *testing.T) {
165165
}
166166

167167
func Test_CheckKeyPair(t *testing.T) {
168-
assertBool := cryptobin_test.AssertBoolT(t)
169-
assertError := cryptobin_test.AssertErrorT(t)
168+
assertBool := cryptobin_test.AssertTrueT(t)
169+
assertError := cryptobin_test.AssertNoErrorT(t)
170170

171171
{
172172
obj := New().

cryptobin/bip0340/bip0340_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func Test_PublickeyXY(t *testing.T) {
11-
assertError := cryptobin_test.AssertErrorT(t)
11+
assertError := cryptobin_test.AssertNoErrorT(t)
1212
assertEqual := cryptobin_test.AssertEqualT(t)
1313
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
1414

@@ -34,7 +34,7 @@ func Test_PublickeyXY(t *testing.T) {
3434
}
3535

3636
func Test_PublickeyXY_2(t *testing.T) {
37-
assertError := cryptobin_test.AssertErrorT(t)
37+
assertError := cryptobin_test.AssertNoErrorT(t)
3838
assertEqual := cryptobin_test.AssertEqualT(t)
3939
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
4040

@@ -60,7 +60,7 @@ func Test_PublickeyXY_2(t *testing.T) {
6060
}
6161

6262
func Test_PublickeyXY_String(t *testing.T) {
63-
assertError := cryptobin_test.AssertErrorT(t)
63+
assertError := cryptobin_test.AssertNoErrorT(t)
6464
assertEqual := cryptobin_test.AssertEqualT(t)
6565
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
6666

@@ -81,7 +81,7 @@ func Test_PublickeyXY_String(t *testing.T) {
8181
}
8282

8383
func Test_PublickeyXY_Bytes(t *testing.T) {
84-
assertError := cryptobin_test.AssertErrorT(t)
84+
assertError := cryptobin_test.AssertNoErrorT(t)
8585
assertEqual := cryptobin_test.AssertEqualT(t)
8686
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
8787

@@ -104,7 +104,7 @@ func Test_PublickeyXY_Bytes(t *testing.T) {
104104
}
105105

106106
func Test_PrivateKeyD(t *testing.T) {
107-
assertError := cryptobin_test.AssertErrorT(t)
107+
assertError := cryptobin_test.AssertNoErrorT(t)
108108
assertEqual := cryptobin_test.AssertEqualT(t)
109109
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
110110

@@ -124,7 +124,7 @@ func Test_PrivateKeyD(t *testing.T) {
124124
}
125125

126126
func Test_PrivateKey_Bytes(t *testing.T) {
127-
assertError := cryptobin_test.AssertErrorT(t)
127+
assertError := cryptobin_test.AssertNoErrorT(t)
128128
assertEqual := cryptobin_test.AssertEqualT(t)
129129
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
130130

@@ -146,7 +146,7 @@ func Test_PrivateKey_Bytes(t *testing.T) {
146146
}
147147

148148
func Test_GetPrivateKeyString(t *testing.T) {
149-
assertError := cryptobin_test.AssertErrorT(t)
149+
assertError := cryptobin_test.AssertNoErrorT(t)
150150
assertEqual := cryptobin_test.AssertEqualT(t)
151151
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
152152

@@ -196,7 +196,7 @@ func Test_CreatePKCS1PrivateKeyWithPassword(t *testing.T) {
196196

197197
func test_CreatePKCS1PrivateKeyWithPassword(t *testing.T, cipher string) {
198198
assertEqual := cryptobin_test.AssertEqualT(t)
199-
assertError := cryptobin_test.AssertErrorT(t)
199+
assertError := cryptobin_test.AssertNoErrorT(t)
200200
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
201201

202202
t.Run(cipher, func(t *testing.T) {
@@ -228,7 +228,7 @@ func test_CreatePKCS1PrivateKeyWithPassword(t *testing.T, cipher string) {
228228
}
229229

230230
func Test_PKCS8PrivateKey_Der(t *testing.T) {
231-
assertError := cryptobin_test.AssertErrorT(t)
231+
assertError := cryptobin_test.AssertNoErrorT(t)
232232
assertEqual := cryptobin_test.AssertEqualT(t)
233233
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
234234

@@ -250,7 +250,7 @@ func Test_PKCS8PrivateKey_Der(t *testing.T) {
250250
}
251251

252252
func Test_PKCS1PrivateKey_Der(t *testing.T) {
253-
assertError := cryptobin_test.AssertErrorT(t)
253+
assertError := cryptobin_test.AssertNoErrorT(t)
254254
assertEqual := cryptobin_test.AssertEqualT(t)
255255
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
256256

@@ -272,7 +272,7 @@ func Test_PKCS1PrivateKey_Der(t *testing.T) {
272272
}
273273

274274
func Test_PublicKey_Der(t *testing.T) {
275-
assertError := cryptobin_test.AssertErrorT(t)
275+
assertError := cryptobin_test.AssertNoErrorT(t)
276276
assertEqual := cryptobin_test.AssertEqualT(t)
277277
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
278278

@@ -330,8 +330,8 @@ func Test_SignWithEncoding(t *testing.T) {
330330

331331
func test_SignWithEncoding(t *testing.T, encoding EncodingType) {
332332
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
333-
assertBool := cryptobin_test.AssertBoolT(t)
334-
assertError := cryptobin_test.AssertErrorT(t)
333+
assertBool := cryptobin_test.AssertTrueT(t)
334+
assertError := cryptobin_test.AssertNoErrorT(t)
335335

336336
gen := GenerateKey("S256")
337337

@@ -358,7 +358,7 @@ func test_SignWithEncoding(t *testing.T, encoding EncodingType) {
358358
}
359359

360360
func Test_SignWithEncoding_Two_Check(t *testing.T) {
361-
assertError := cryptobin_test.AssertErrorT(t)
361+
assertError := cryptobin_test.AssertNoErrorT(t)
362362
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
363363
assertNotEqual := cryptobin_test.AssertNotEqualT(t)
364364

@@ -406,7 +406,7 @@ func Test_GenKey(t *testing.T) {
406406
}
407407

408408
func test_GenKey(t *testing.T, curve string) {
409-
assertError := cryptobin_test.AssertErrorT(t)
409+
assertError := cryptobin_test.AssertNoErrorT(t)
410410
assertEqual := cryptobin_test.AssertEqualT(t)
411411
assertNotEmpty := cryptobin_test.AssertNotEmptyT(t)
412412

0 commit comments

Comments
 (0)