When calculating result rank, identifier quotes should be ignored. The result ranking algorithm ignores identifier quotes. Without this correction, the match "user", which Postgres requires to be quoted since it is also a reserved word, would incorrectly fall below the match user_ac
(completer)
| 9 | |
| 10 | |
| 11 | def test_ranking_ignores_identifier_quotes(completer): |
| 12 | """When calculating result rank, identifier quotes should be ignored. |
| 13 | |
| 14 | The result ranking algorithm ignores identifier quotes. Without this |
| 15 | correction, the match "user", which Postgres requires to be quoted |
| 16 | since it is also a reserved word, would incorrectly fall below the |
| 17 | match user_action because the literal quotation marks in "user" |
| 18 | alter the position of the match. |
| 19 | |
| 20 | This test checks that the fuzzy ranking algorithm correctly ignores |
| 21 | quotation marks when computing match ranks. |
| 22 | |
| 23 | """ |
| 24 | |
| 25 | text = "user" |
| 26 | collection = ["user_action", '"user"'] |
| 27 | matches = completer.find_matches(text, collection) |
| 28 | assert len(matches) == 2 |
| 29 | |
| 30 | |
| 31 | def test_ranking_based_on_shortest_match(completer): |
nothing calls this directly
no test coverage detected