basic version

This commit is contained in:
dmfed
2021-03-20 21:10:53 +03:00
committed by Dmitry Fedotov
parent 6cc9cd65fb
commit 27cb532ec4
10 changed files with 697 additions and 69 deletions

View File

@@ -1,31 +0,0 @@
package conf
import (
"bytes"
"fmt"
"testing"
)
var testConf = []byte(`network
server=10.0.0.10
port=10000
token=test
editor=vim
color`)
func TestParser(t *testing.T) {
r := bytes.NewReader(testConf)
c := parseReader(r)
if c.Get("token") != "test" {
fmt.Println("failed finding key value")
t.Fail()
}
if c.GetInt("port") != 10000 {
fmt.Println("failed finding int")
t.Fail()
}
if c.GetBool("color") != true {
fmt.Println("failed finding bool")
t.Fail()
}
}