mirror of
https://github.com/luscis/openlan.git
synced 2025-10-05 16:47:11 +08:00
19 lines
474 B
Go
19 lines
474 B
Go
package config
|
|
|
|
import (
|
|
"github.com/luscis/openlan/pkg/libol"
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
func TestSwitch(t *testing.T) {
|
|
sw := Switch{}
|
|
sw.Correct()
|
|
assert.Equal(t, libol.INFO, sw.Log.Verbose, "be the same.")
|
|
assert.Equal(t, "0.0.0.0:10002", sw.Listen, "be the same.")
|
|
assert.Equal(t, "0.0.0.0:10000", sw.Http.Listen, "be the same.")
|
|
sw.Listen = "192.168.1.0"
|
|
sw.Correct()
|
|
assert.Equal(t, "192.168.1.0:10002", sw.Listen, "be the same.")
|
|
}
|