Compare commits
1 commit
04cf704010
...
116cfcbf7b
Author | SHA1 | Date | |
---|---|---|---|
116cfcbf7b |
1 changed files with 12 additions and 5 deletions
|
@ -548,11 +548,11 @@ func TestPlacementPolicy_NonAsciiAttributes(t *testing.T) {
|
|||
p := newPlacementPolicy(
|
||||
1,
|
||||
[]ReplicaDescriptor{
|
||||
newReplica(2, ""),
|
||||
newReplica(2, ""),
|
||||
newReplica(2, "Nodes"),
|
||||
newReplica(2, "Nodes"),
|
||||
},
|
||||
[]Selector{
|
||||
newSelector("", "Цвет", 2, "Colorful", (*Selector).SelectSame),
|
||||
newSelector("Nodes", "Цвет", 2, "Colorful", (*Selector).SelectSame),
|
||||
},
|
||||
[]Filter{
|
||||
newFilter("Colorful", "", "", netmap.OR,
|
||||
|
@ -568,13 +568,15 @@ func TestPlacementPolicy_NonAsciiAttributes(t *testing.T) {
|
|||
nodeInfoFromAttributes("Цвет", "Красный", "Форма", "Круг"),
|
||||
nodeInfoFromAttributes("Цвет", "Синий", "Форма", "Треугольник"),
|
||||
nodeInfoFromAttributes("Цвет", "Синий", "Форма", "Круг"),
|
||||
nodeInfoFromAttributes("Свойство", "Мягкий", "Форма", "Треугольник"),
|
||||
nodeInfoFromAttributes("Свойство", "Теплый", "Форма", "Круг"),
|
||||
}
|
||||
for i := range nodes {
|
||||
nodes[i].SetPublicKey([]byte{byte(i)})
|
||||
}
|
||||
|
||||
redNodes := nodes[:2]
|
||||
blueNodes := nodes[2:]
|
||||
blueNodes := nodes[2:4]
|
||||
|
||||
var nm NetMap
|
||||
nm.SetNodes(nodes)
|
||||
|
@ -593,13 +595,18 @@ func TestPlacementPolicy_NonAsciiAttributes(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
t.Log(nodesPerReplica[0])
|
||||
t.Log(nodesPerReplica[1])
|
||||
t.Log(redNodes)
|
||||
t.Log(blueNodes)
|
||||
|
||||
redMatchFirst := reflect.DeepEqual(redNodes, nodesPerReplica[0])
|
||||
blueMatchFirst := reflect.DeepEqual(blueNodes, nodesPerReplica[0])
|
||||
|
||||
redMatchSecond := reflect.DeepEqual(redNodes, nodesPerReplica[1])
|
||||
blueMatchSecond := reflect.DeepEqual(blueNodes, nodesPerReplica[1])
|
||||
|
||||
assert.True(t, redMatchFirst && blueMatchSecond || blueMatchFirst && redMatchSecond)
|
||||
assert.True(t, (redMatchFirst && blueMatchSecond) || (blueMatchFirst && redMatchSecond))
|
||||
}
|
||||
|
||||
func TestSelector_SetName(t *testing.T) {
|
||||
|
|
Loading…
Add table
Reference in a new issue