Allow time unit variables to be 0
plugins.checkFrequency can be disabled by setting the time to 0, but this is not allowed in a time unit typed variable due to the regex requiring the value to start with a digit in the range 1-9. Permit 0 as a value. Change-Id: I2deca08fe9b0ea93ef23f626fc44cffe98ad2d95
This commit is contained in:
@@ -26,9 +26,11 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class ConfigUtilTest extends TestCase {
|
||||
public void testTimeUnit() {
|
||||
assertEquals(ms(0, MILLISECONDS), parse("0"));
|
||||
assertEquals(ms(2, MILLISECONDS), parse("2ms"));
|
||||
assertEquals(ms(200, MILLISECONDS), parse("200 milliseconds"));
|
||||
|
||||
assertEquals(ms(0, SECONDS), parse("0s"));
|
||||
assertEquals(ms(2, SECONDS), parse("2s"));
|
||||
assertEquals(ms(231, SECONDS), parse("231sec"));
|
||||
assertEquals(ms(1, SECONDS), parse("1second"));
|
||||
|
||||
Reference in New Issue
Block a user