MCPcopy
hub / github.com/pathwaycom/pathway / test_linked_list_len

Function test_linked_list_len

python/pathway/tests/test_examples.py:104–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102
103
104def 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
138def test_linked_list_reversal():

Callers

nothing calls this directly

Calls 4

TFunction · 0.90
selectMethod · 0.45
pointer_fromMethod · 0.45

Tested by

no test coverage detected