mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Merge pull request #3978 from ripcurlx/accept-empty-option-values
Accept empty config values
This commit is contained in:
commit
c411f48d43
@ -20,7 +20,7 @@ class ConfigFileOption {
|
||||
|
||||
String[] tokens = clean(option).split("=");
|
||||
String name = tokens[0].trim();
|
||||
String arg = tokens[1].trim();
|
||||
String arg = tokens.length > 1 ? tokens[1].trim() : "";
|
||||
return new ConfigFileOption(name, arg);
|
||||
}
|
||||
|
||||
|
@ -33,4 +33,13 @@ public class ConfigFileOptionTests {
|
||||
assertThat(option.arg, equalTo("example.com:8080"));
|
||||
assertThat(option.toString(), equalTo("host1=example.com:8080"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenOptionHasNoValue_thenItSetsEmptyValue() {
|
||||
String value = "host1=";
|
||||
ConfigFileOption option = ConfigFileOption.parse(value);
|
||||
assertThat(option.name, equalTo("host1"));
|
||||
assertThat(option.arg, equalTo(""));
|
||||
assertThat(option.toString(), equalTo("host1="));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user