Skip to content

Add CLI validation tests for supported engines #27

Description

@karust

Context

Passing an unknown engine name currently fails with no "x" search engine found,
which doesn't tell the user what's valid. Browser mode and raw mode also support
different engine sets, and nothing pins that behavior in a test.

Scope

  1. Make the unknown-engine error list the valid engine names for the mode.
  2. Add a table test in cmd/ asserting:
    • browser mode accepts google, yandex, baidu, bing, duckduckgo, ecosia;
    • raw mode accepts google, yandex, baidu, ecosia and returns a clear
      error for bing and duckduckgo;
    • an unknown name returns the new listing error.

Done when

  • The error message names the valid engines for the mode.
  • The test covers browser mode, raw mode, and the unknown-engine case.

Contributor notes

Both dispatch switches live in cmd/search.go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions