Configuration file syntax and parsing for golang
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

32 lines
615 B

package forge_test
import (
"testing"
"github.com/brettlangdon/forge"
)
func TestSectionKeys(t *testing.T) {
t.Parallel()
section := forge.NewSection()
section.SetString("key1", "value1")
section.SetString("key2", "value2")
section.SetString("key3", "value3")
keys := section.Keys()
if len(keys) != 3 {
t.Error("expected Section to have 3 keys")
}
if keys[0] != "key1" {
t.Error("expected 'key1' to be in the list of keys")
}
if keys[1] != "key2" {
t.Error("expected 'key2' to be in the list of keys")
}
if keys[2] != "key3" {
t.Error("expected 'key3' to be in the list of keys")
}
}