MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / test_token_str_pos

Function test_token_str_pos

tests/parseutils/test_ctes.py:13–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12
13def test_token_str_pos():
14 sql = 'SELECT * FROM xxx'
15 p = parse(sql)[0]
16 idx = p.token_index(p.tokens[-1])
17 assert token_start_pos(p.tokens, idx) == len('SELECT * FROM ')
18
19 sql = 'SELECT * FROM \nxxx'
20 p = parse(sql)[0]
21 idx = p.token_index(p.tokens[-1])
22 assert token_start_pos(p.tokens, idx) == len('SELECT * FROM \n')
23
24
25def test_single_column_name_extraction():

Callers

nothing calls this directly

Calls 1

token_start_posFunction · 0.90

Tested by

no test coverage detected