Improve "Did you mean?" suggestions (#6579)

* Copy lev_distance.rs from the rust compiler

* Minor changes to code from rust compiler

* "Did you mean" suggestions: test instrumented to generate markdown report

* Did you mean suggestions: delete test instrumentation

* Fix tests

* Fix test

`foo` has a genuine match: `for`

* Improve tests
This commit is contained in:
Dan Davison
2022-09-20 20:46:01 -04:00
committed by GitHub
parent 9aed95408d
commit ad0c6bf7d5
11 changed files with 348 additions and 151 deletions

View File

@ -137,8 +137,8 @@ fn errors_fetching_by_column_not_present() {
sandbox.with_files(vec![FileWithContent(
"sample.toml",
r#"
[taconushell]
sentence_words = ["Yo", "quiero", "taconushell"]
[tacos]
sentence_words = ["Yo", "quiero", "tacos"]
[pizzanushell]
sentence-words = ["I", "want", "pizza"]
"#,
@ -153,7 +153,7 @@ fn errors_fetching_by_column_not_present() {
));
assert!(actual.err.contains("Name not found"),);
assert!(actual.err.contains("did you mean 'taconushell'"),);
assert!(actual.err.contains("did you mean 'tacos'"),);
})
}