Ejemplo n.º 1
0
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++
	}
}
Ejemplo n.º 2
0
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
}
Ejemplo n.º 3
0
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
		}
	}

}