use clap::Parser; use server::Config; #[test] fn parses_from_args_with_defaults() { let cfg = Config::try_parse_from(["server", "--database-url", "postgres://localhost/test"]) .expect("should parse"); assert_eq!(cfg.database_url, "postgres://localhost/test"); assert_eq!(cfg.bind_addr, "0.0.0.0:8080"); assert_eq!(cfg.app_name, "Collection Management System"); } #[test] fn database_url_is_required() { assert!(Config::try_parse_from(["server"]).is_err()); }