MCPcopy
hub / github.com/andialbrecht/sqlparse / test_simple_1d_array_index

Function test_simple_1d_array_index

tests/test_parse.py:256–263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

254
255
256def test_simple_1d_array_index():
257 p = sqlparse.parse('col[1]')[0].tokens
258 assert len(p) == 1
259 assert p[0].get_name() == 'col'
260 indices = list(p[0].get_array_indices())
261 assert len(indices) == 1 # 1-dimensional index
262 assert len(indices[0]) == 1 # index is single token
263 assert indices[0][0].value == '1'
264
265
266def test_2d_array_index():

Callers

nothing calls this directly

Calls 2

get_nameMethod · 0.80
get_array_indicesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…