Skip to content

Commit

Permalink
Use the Default trait and the pretty_assertions in search selector te…
Browse files Browse the repository at this point in the history
…sts.

This should make it easier to see the important part of tests, and to have a better output when tests fail.
  • Loading branch information
Standard8 committed Dec 16, 2024
1 parent 1b9d2eb commit 5aec372
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 308 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions components/search/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ uniffi = { version = "0.28.2", features = ["build"] }

[dev-dependencies]
once_cell = "1.18.0"
pretty_assertions = "0.6"
6 changes: 3 additions & 3 deletions components/search/src/configuration_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl JSONEngineMethod {
/// Defines an individual search engine URL. This is defined separately to
/// `types::SearchEngineUrl` as various fields may be optional in the supplied
/// configuration.
#[derive(Debug, uniffi::Record, PartialEq, Deserialize, Clone)]
#[derive(Debug, uniffi::Record, PartialEq, Deserialize, Clone, Default)]
#[serde(rename_all = "camelCase")]
pub(crate) struct JSONEngineUrl {
/// The PrePath and FilePath of the URL. May include variables for engines
Expand All @@ -55,7 +55,7 @@ pub(crate) struct JSONEngineUrl {
}

/// Reflects `types::SearchEngineUrls`, but using `EngineUrl`.
#[derive(Debug, uniffi::Record, PartialEq, Deserialize, Clone)]
#[derive(Debug, uniffi::Record, PartialEq, Deserialize, Clone, Default)]
#[serde(rename_all = "camelCase")]
pub(crate) struct JSONEngineUrls {
/// The URL to use for searches.
Expand All @@ -69,7 +69,7 @@ pub(crate) struct JSONEngineUrls {
}

/// Represents the engine base section of the configuration.
#[derive(Debug, Deserialize, Clone)]
#[derive(Debug, Default, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub(crate) struct JSONEngineBase {
/// A list of aliases for this engine.
Expand Down
Loading

0 comments on commit 5aec372

Please sign in to comment.