Treap built with priorities being hashes (minhash is the root, and recursively), sorted according to key column.
()
| 30 | |
| 31 | |
| 32 | def test_prevnext_single_instance(): |
| 33 | """Treap built with priorities being hashes (minhash is the root, and recursively), |
| 34 | sorted according to key column.""" |
| 35 | nodes = T( |
| 36 | """ |
| 37 | | key | instance |
| 38 | 1 | 1 | 42 |
| 39 | 2 | 5 | 42 |
| 40 | 3 | 3 | 42 |
| 41 | 4 | 8 | 42 |
| 42 | 5 | 2 | 42 |
| 43 | """ |
| 44 | ) |
| 45 | result = nodes.sort(key=nodes.key, instance=nodes.instance) |
| 46 | |
| 47 | assert_table_equality( |
| 48 | result, |
| 49 | T( |
| 50 | """ |
| 51 | | next | prev |
| 52 | 1 | 5 | |
| 53 | 2 | 4 | 3 |
| 54 | 3 | 2 | 5 |
| 55 | 4 | | 2 |
| 56 | 5 | 3 | 1 |
| 57 | """, |
| 58 | ).select( |
| 59 | prev=nodes.pointer_from(this.prev, optional=True), |
| 60 | next=nodes.pointer_from(this.next, optional=True), |
| 61 | ), |
| 62 | ) |
| 63 | |
| 64 | |
| 65 | def test_prevnext_many_instance(): |
nothing calls this directly
no test coverage detected