Browse Source

add test for Section.Keys

pull/16/head
Brett Langdon 11 years ago
parent
commit
31c5e826e3
1 changed files with 32 additions and 0 deletions
  1. +32
    -0
      section_test.go

+ 32
- 0
section_test.go View File

@ -0,0 +1,32 @@
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")
}
}

Loading…
Cancel
Save