refactor: type config tests
This commit is contained in:
parent
d1162e1728
commit
e9a5136c8d
@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
http_addr: String,
|
pub http_addr: String,
|
||||||
database_path: String,
|
pub database_path: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
@ -16,8 +16,8 @@ impl Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn load_from_file(_config_path: &str) -> Result<Config, Error> {
|
pub fn load_from_file(_config_path: &str) -> Result<Config, Error> {
|
||||||
unimplemented!();
|
todo!();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,12 +3,11 @@ mod tests {
|
|||||||
use rustysearch::types::config::Config;
|
use rustysearch::types::config::Config;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_search_engine() {
|
fn test_create_new_config() {
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let config_two = Config::new();
|
let config_two = Config::new();
|
||||||
println!("{:?}", config);
|
|
||||||
println!("{:?}", config_two);
|
|
||||||
|
|
||||||
// assert_eq!(config.http, 1);
|
assert_eq!(config.http_addr, "127.0.0.1:4000");
|
||||||
|
assert_eq!(config_two.http_addr, "127.0.0.1:4000");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user