Пример #1
0
func testall(t *testing.T, tst map[string][]string, reg *regexp.Regexp) {
	for k, v := range tst {
		cnt := int(0)
		cnt = 0
		for s := range reg.AllMatchesStringIter(k, 0) {
			//    fmt.Println(s)
			if cnt == len(v) {
				t.Error(k + " parse returned more elems than in v")
				break
			}
			if s != v[cnt] {
				t.Error(s + " doesn't matches " + v[cnt])
			}
			cnt++
		}
	}
}