Test command names and search terms for redundancy (#6380)

* Test commands for proper names and search terms

Assert that the `Command.name()` is equal to `Signature.name`

Check that search terms are not just substrings of the command name as
they would not help finding the command.

* Clean up search terms

Remove redundant terms that just replicate the command name.
Try to eliminate substring between search terms, clean up where
necessary.
This commit is contained in:
Stefan Holderbach
2022-08-24 11:16:47 +02:00
committed by GitHub
parent ef26d539a7
commit 0afe1e4e67
68 changed files with 126 additions and 91 deletions

View File

@ -34,7 +34,7 @@ impl Command for CollectDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "collect"]
vec!["database"]
}
fn run(

View File

@ -47,7 +47,7 @@ impl Command for DescribeDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "SQLite", "describe"]
vec!["database", "SQLite"]
}
fn run(

View File

@ -41,7 +41,7 @@ impl Command for FromDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "from"]
vec!["database"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -49,7 +49,7 @@ impl Command for IntoSqliteDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["convert", "sqlite", "database"]
vec!["convert", "database"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -47,7 +47,7 @@ impl Command for JoinDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "join"]
vec!["database"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -34,7 +34,7 @@ impl Command for LimitDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "limit"]
vec!["database", "head", "tail"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -29,7 +29,7 @@ impl Command for OpenDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "open"]
vec!["database"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -37,7 +37,7 @@ impl Command for OrderByDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "order-by"]
vec!["database"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -34,7 +34,7 @@ impl Command for SchemaDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "info", "SQLite", "schema"]
vec!["database", "info", "SQLite"]
}
fn run(

View File

@ -33,7 +33,7 @@ impl Command for ProjectionDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "select"]
vec!["database"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -30,7 +30,7 @@ impl Command for ToDataBase {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "into", "db"]
vec!["database", "convert"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -31,7 +31,7 @@ impl Command for WhereDb {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "where"]
vec!["database"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -30,7 +30,7 @@ impl Command for AndExpr {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "and", "expression"]
vec!["database", "expression"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -30,7 +30,7 @@ impl Command for OrExpr {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "or", "expression"]
vec!["database", "expression"]
}
fn examples(&self) -> Vec<Example> {

View File

@ -92,7 +92,7 @@ impl Command for OverExpr {
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "over", "expression"]
vec!["database", "expression"]
}
fn run(