Treap built with priorities being hashes (minhash is the root, and recursively), sorted according to key column.
()
| 63 | |
| 64 | |
| 65 | def test_prevnext_many_instance(): |
| 66 | """Treap built with priorities being hashes (minhash is the root, and recursively), |
| 67 | sorted according to key column.""" |
| 68 | nodes = T( |
| 69 | """ |
| 70 | | key | instance |
| 71 | 1 | 1 | 42 |
| 72 | 2 | 1 | 28 |
| 73 | 3 | 5 | 42 |
| 74 | 4 | 5 | 28 |
| 75 | 5 | 3 | 42 |
| 76 | 6 | 3 | 28 |
| 77 | 7 | 8 | 42 |
| 78 | 8 | 8 | 28 |
| 79 | 9 | 2 | 42 |
| 80 | 10| 2 | 28 |
| 81 | """ |
| 82 | ) |
| 83 | result = nodes.sort(key=nodes.key, instance=nodes.instance) |
| 84 | |
| 85 | assert_table_equality( |
| 86 | result, |
| 87 | T( |
| 88 | """ |
| 89 | | next | prev |
| 90 | 1 | 9 | |
| 91 | 2 | 10 | |
| 92 | 3 | 7 | 5 |
| 93 | 4 | 8 | 6 |
| 94 | 5 | 3 | 9 |
| 95 | 6 | 4 | 10 |
| 96 | 7 | | 3 |
| 97 | 8 | | 4 |
| 98 | 9 | 5 | 1 |
| 99 | 10 | 6 | 2 |
| 100 | """, |
| 101 | ).select( |
| 102 | prev=nodes.pointer_from(this.prev, optional=True), |
| 103 | next=nodes.pointer_from(this.next, optional=True), |
| 104 | ), |
| 105 | ) |
nothing calls this directly
no test coverage detected