ax(ueps): replace non-standard errorA/errorB with idiomatic err
AX Principle 1 — predictable names over short/non-standard names. errorA and errorB are not ecosystem-standard; err is the correct name for error variables. Each call now checks err immediately after capture, matching the established Go and Core convention. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
6010f02091
commit
8a4af1634f
1 changed files with 9 additions and 5 deletions
|
|
@ -106,12 +106,16 @@ func TestPacket_MarshalAndSign_Good(t *testing.T) {
|
|||
func TestPacket_MarshalAndSign_Bad(t *testing.T) {
|
||||
builder := NewBuilder(0x02, []byte("data"))
|
||||
|
||||
frame1, errorA := builder.MarshalAndSign([]byte("secret-a"))
|
||||
frame2, errorB := builder.MarshalAndSign([]byte("secret-b"))
|
||||
|
||||
if errorA != nil || errorB != nil {
|
||||
t.Fatalf("MarshalAndSign errors: %v, %v", errorA, errorB)
|
||||
frame1, err := builder.MarshalAndSign([]byte("secret-a"))
|
||||
if err != nil {
|
||||
t.Fatalf("MarshalAndSign(secret-a) failed: %v", err)
|
||||
}
|
||||
|
||||
frame2, err := builder.MarshalAndSign([]byte("secret-b"))
|
||||
if err != nil {
|
||||
t.Fatalf("MarshalAndSign(secret-b) failed: %v", err)
|
||||
}
|
||||
|
||||
if bytes.Equal(frame1, frame2) {
|
||||
t.Error("expected different frames for different secrets, got identical frames")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue