mirror of
https://codeberg.org/icewind/nextcloud-config-parser.git
synced 2026-06-03 16:44:09 +02:00
fix parsing with new default comment
This commit is contained in:
parent
20d09d186d
commit
1da941262e
4 changed files with 65 additions and 2 deletions
|
|
@ -81,6 +81,36 @@ fn test_parse_config_basic() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_config_example_comment() {
|
||||
let config = config_from_file("tests/configs/comment_example.php");
|
||||
assert_eq!("https://cloud.example.com", config.nextcloud_url);
|
||||
assert_eq!("oc_", config.database_prefix);
|
||||
assert_debug_equal(
|
||||
&Database::MySql {
|
||||
database: "nextcloud".to_string(),
|
||||
username: "nextcloud".to_string(),
|
||||
password: "secret".to_string(),
|
||||
connect: DbConnect::Tcp {
|
||||
host: "127.0.0.1".to_string(),
|
||||
port: 3306,
|
||||
},
|
||||
ssl_options: SslOptions::Disabled,
|
||||
},
|
||||
&config.database,
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
config.database.url(),
|
||||
"mysql://nextcloud:secret@127.0.0.1/nextcloud?ssl-mode=disabled"
|
||||
);
|
||||
|
||||
assert_debug_equal(
|
||||
RedisConfig::Single(parse_redis("redis://127.0.0.1")),
|
||||
config.redis,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_implicit_prefix() {
|
||||
let config = config_from_file("tests/configs/implicit_prefix.php");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue