MCPcopy Index your code
hub / github.com/dbcli/pgcli / test_token_str_pos

Function test_token_str_pos

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

token_start_posFunction · 0.90

Tested by

no test coverage detected