This repository has been archived on 2015-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
jsh/utils_test.go
2014-09-04 02:30:52 -04:00

15 lines
317 B
Go

package jsh
import "testing"
func TestFieldsN(t *testing.T) {
testString := "Potatoes are the best strings for testing."
for i := 1; i <= 10; i++ {
fields := FieldsN(testString, i)
fieldsLength := len(fields)
if fieldsLength > i {
t.Errorf("Expected at most %d fields, got %d", i, fieldsLength)
}
}
}