()
| 102 | |
| 103 | |
| 104 | def test_linked_list_len(): |
| 105 | nodes = T( |
| 106 | """ |
| 107 | | next |
| 108 | 1 | 2 |
| 109 | 2 | 3 |
| 110 | 3 | 4 |
| 111 | 4 | 5 |
| 112 | 5 | 6 |
| 113 | 6 | 7 |
| 114 | 7 | 8 |
| 115 | 8 | |
| 116 | """, |
| 117 | ) |
| 118 | nodes = nodes.select(next=nodes.pointer_from(this.next, optional=True)) |
| 119 | expected = T( |
| 120 | """ |
| 121 | | len |
| 122 | 1 | 8 |
| 123 | 2 | 7 |
| 124 | 3 | 6 |
| 125 | 4 | 5 |
| 126 | 5 | 4 |
| 127 | 6 | 3 |
| 128 | 7 | 2 |
| 129 | 8 | 1 |
| 130 | """ |
| 131 | ) |
| 132 | |
| 133 | ret = linked_list_transformer(linked_list=nodes).linked_list |
| 134 | |
| 135 | assert_table_equality_wo_types(ret.select(ret.len), expected) |
| 136 | |
| 137 | |
| 138 | def test_linked_list_reversal(): |
nothing calls this directly
no test coverage detected