func RunSetEnumerator(list Collection, t *testing.T) { list.Add(unsortedArray...) pos := 0 for e := list.Enumerator(); e.HasNext(); { if !toolkit.Match(unsortedArray[pos], e.Next()) { t.Error("The enumeration did not return the same elements") } pos++ } }
func (this *Token) matchMembers(m []Tokener) bool { if this.Members == nil || m == nil || len(this.Members) != len(m) { return false } for idx, o := range this.Members { if !tk.Match(o, m[idx]) { return false } } return true }
func RunSetInEnumerator(list Collection, t *testing.T) { list.Add(unsortedArray...) for _, v := range unsortedArray { var found = false for e := list.Enumerator(); e.HasNext(); { if toolkit.Match(v, e.Next()) { found = true } } if !found { t.Errorf("The enumeration did not found the element %s in %s\n", v, list.Elements()) return } } }