mirror of
https://github.com/mochi-mqtt/server.git
synced 2025-10-05 00:02:52 +08:00

* fix typos, indicate unused returns * Add test for publishToClient acl unauthorized * Add Inline Client as a server option
30 lines
460 B
Go
30 lines
460 B
Go
// SPDX-License-Identifier: MIT
|
|
// SPDX-FileCopyrightText: 2022 mochi-mqtt, mochi-co
|
|
// SPDX-FileContributor: mochi-co
|
|
|
|
package packets
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestCodesString(t *testing.T) {
|
|
c := Code{
|
|
Reason: "test",
|
|
Code: 0x1,
|
|
}
|
|
|
|
require.Equal(t, "test", c.String())
|
|
}
|
|
|
|
func TestCodesError(t *testing.T) {
|
|
c := Code{
|
|
Reason: "error",
|
|
Code: 0x1,
|
|
}
|
|
|
|
require.Equal(t, "error", error(c).Error())
|
|
}
|