You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"half of the resources matches", NewResourceFromMap(map[string]Quantity{"first": 10, "second": 10}), NewResourceFromMap(map[string]Quantity{"first": 10}), 50},
2486
+
{"one third of the resources matches", NewResourceFromMap(map[string]Quantity{"first": 10, "second": 10, "third": 10}), NewResourceFromMap(map[string]Quantity{"first": 10}), 33},
2487
+
{"one fourth of the resources matches", NewResourceFromMap(map[string]Quantity{"first": 10, "second": 10, "third": 10, "fourth": 10}), NewResourceFromMap(map[string]Quantity{"first": 10}), 25},
2488
+
{"one fourth of the resources matches, extra types in other resource should not affect", NewResourceFromMap(map[string]Quantity{"first": 10, "second": 10, "third": 10, "fourth": 10}), NewResourceFromMap(map[string]Quantity{"first": 10, "fifth": 10, "sixth": 10}), 25},
{"negative valued resource on left side, ask is nil", NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5}), NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0}), nil, nil, -1},
2512
+
{"negative valued resource on right side, ask is nil", NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0}), NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5}), nil, nil, 1},
2513
+
{"negative valued resource but extra types differs and not present in ask", NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5, "extra_a": 1}), NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5, "extra_a": 2}), nil, NewResourceFromMap(map[string]Quantity{"large": 5}), 0},
2514
+
{"zero valued resource with total but extra types differs and not present in ask", NewResourceFromMap(map[string]Quantity{"zero": 0, "extra_a": 1}), NewResourceFromMap(map[string]Quantity{"zero": 0, "extra_a": 2}), NewResource(), NewResourceFromMap(map[string]Quantity{"zero": 0}), 0},
2515
+
{"same resource and total but extra types differs and not present in ask", NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5, "extra_a": 1}), NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5, "extra_a": 2}), NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5, "extra_a": 10}), NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5}), 0},
2516
+
{"left side has more one negative value for type present in ask but not present in right", NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5}), NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0}), NewResourceFromMap(map[string]Quantity{"large": 10, "zero": 10}), NewResourceFromMap(map[string]Quantity{"large": 100, "zero": 100, "small": 5}), -1},
2517
+
{"left side has more one negative value but not present in ask", NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5}), NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0}), NewResourceFromMap(map[string]Quantity{"large": 10, "zero": 10}), NewResourceFromMap(map[string]Quantity{"large": 100, "zero": 100}), 0},
2518
+
{"right side has more one negative value for type present in ask but not present in left", NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0}), NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5}), NewResourceFromMap(map[string]Quantity{"large": 10, "zero": 10}), NewResourceFromMap(map[string]Quantity{"large": 100, "zero": 100, "small": 5}), 1},
2519
+
{"right side has more one negative value but not present in ask", NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0}), NewResourceFromMap(map[string]Quantity{"large": 5, "zero": 0, "small": -5}), NewResourceFromMap(map[string]Quantity{"large": 10, "zero": 10}), NewResourceFromMap(map[string]Quantity{"large": 100, "zero": 100}), 0},
2520
+
{"left side first one bigger, last one smaller. right side vice versa. but share wise same", NewResourceFromMap(map[string]Quantity{"first": 10, "second": 5}), NewResourceFromMap(map[string]Quantity{"first": 5, "second": 10}), NewResourceFromMap(map[string]Quantity{"first": 15, "second": 15}), NewResourceFromMap(map[string]Quantity{"first": 1, "second": 1}), 0},
2521
+
{"left side first one bigger, last one smaller. right side vice versa. but share wise not same", NewResourceFromMap(map[string]Quantity{"first": 10, "second": 5}), NewResourceFromMap(map[string]Quantity{"first": 5, "second": 10}), NewResourceFromMap(map[string]Quantity{"first": 15}), NewResourceFromMap(map[string]Quantity{"first": 1, "second": 1}), -1},
2522
+
{"left side first one bigger, last one smaller. right side vice versa. but share wise not same. none of the ask res types match", NewResourceFromMap(map[string]Quantity{"first": 10, "second": 5}), NewResourceFromMap(map[string]Quantity{"first": 5, "second": 10}), NewResourceFromMap(map[string]Quantity{"first": 15}), NewResourceFromMap(map[string]Quantity{"third": 1, "fourth": 1}), 0},
2523
+
{"left side first one smaller, last one bigger. right side vice versa. but share wise not same", NewResourceFromMap(map[string]Quantity{"first": 5, "second": 10}), NewResourceFromMap(map[string]Quantity{"first": 10, "second": 5}), NewResourceFromMap(map[string]Quantity{"first": 15}), NewResourceFromMap(map[string]Quantity{"first": 1, "second": 1}), 1},
2524
+
{"left side first one smaller, last one bigger. right side vice versa. but share wise not same. none of the ask res types match", NewResourceFromMap(map[string]Quantity{"first": 5, "second": 10}), NewResourceFromMap(map[string]Quantity{"first": 10, "second": 5}), NewResourceFromMap(map[string]Quantity{"first": 15}), NewResourceFromMap(map[string]Quantity{"third": 1, "fourth": 1}), 0},
2525
+
{"left side key order not same as right side which is aligned with ask order ", NewResourceFromMap(map[string]Quantity{"second": 10, "first": 5}), NewResourceFromMap(map[string]Quantity{"first": 10, "second": 5}), NewResourceFromMap(map[string]Quantity{}), NewResourceFromMap(map[string]Quantity{"first": 1, "second": 1}), 0},
2526
+
{"right side key order not same as left side which is aligned with ask order", NewResourceFromMap(map[string]Quantity{"second": 10, "first": 5}), NewResourceFromMap(map[string]Quantity{"first": 10, "second": 5}), NewResourceFromMap(map[string]Quantity{}), NewResourceFromMap(map[string]Quantity{"second": 1, "first": 1}), 0},
0 commit comments