mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
parent
0083343178
commit
3899f693da
@ -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