mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-20 06:10:00 -08:00
Add 'grumble ctl'.
This commit is contained in:
parent
01182d36b3
commit
41f6af2334
10 changed files with 343 additions and 34 deletions
40
pkg/serverconf/config_test.go
Normal file
40
pkg/serverconf/config_test.go
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// Copyright (c) 2011 The Grumble Authors
|
||||
// The use of this source code is goverened by a BSD-style
|
||||
// license that can be found in the LICENSE-file.
|
||||
|
||||
package serverconf
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestIntValue(t *testing.T) {
|
||||
cfg := make(Config)
|
||||
cfg.Set("Test", "13")
|
||||
if cfg.IntValue("Test") != 13 {
|
||||
t.Errorf("Expected 13")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFloatAsInt(t *testing.T) {
|
||||
cfg := make(Config)
|
||||
cfg.Set("Test", "13.4")
|
||||
if cfg.IntValue("Test") != 0 {
|
||||
t.Errorf("Expected 0")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultValue(t *testing.T) {
|
||||
cfg := make(Config)
|
||||
if cfg.IntValue("MaxBandwidth") != 72000 {
|
||||
t.Errorf("Expected 72000")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBoolValue(t *testing.T) {
|
||||
cfg := make(Config)
|
||||
cfg.Set("DoStuffOnStartup", "true")
|
||||
if cfg.BoolValue("DoStuffOnStartup") != true {
|
||||
t.Errorf("Expected true")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue