Skip to content

Commit

Permalink
Merge pull request #514 from mivek/feature/Gusts_3_digits
Browse files Browse the repository at this point in the history
Feature/gusts 3 digits
  • Loading branch information
mivek authored Aug 22, 2023
2 parents f09c8e2 + a357c06 commit f07affc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public final class WindCommand implements BaseWindCommand {
/** Pattern regex for wind. */
private static final Pattern WIND_REGEX = Pattern.compile("^(VRB|00|[0-3]\\d{2})(\\d{2})G?(\\d{2})?(KT|MPS|KM/H)?");
private static final Pattern WIND_REGEX = Pattern.compile("^(VRB|00|[0-3]\\d{2})(\\d{2})G?(\\d{2,3})?(KT|MPS|KM/H)?");

/**
* Package private constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public final class WindShearCommand implements BaseWindCommand {
/** Pattern regex for windshear. */
private static final Pattern WIND_SHEAR_REGEX = Pattern.compile("^WS(\\d{3})/(\\w{3})(\\d{2})G?(\\d{2})?(KT|MPS|KM/H)");
private static final Pattern WIND_SHEAR_REGEX = Pattern.compile("^WS(\\d{3})/(\\w{3})(\\d{2})G?(\\d{2,3})?(KT|MPS|KM/H)");

/**
* Package private constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,14 @@ void testExecuteWithExistingWind() {
assertTrue(command.execute(m, "VRB08KT"));
assertEquals(wind1, m.getWind());
}

@Test
void testParseWindThreeDigitGust() {
Wind w = command.parseWind("12017G015KT");
assertEquals(Messages.getInstance().getString("Converter.ESE"), w.getDirection());
assertEquals(120, w.getDirectionDegrees());
assertEquals(17, w.getSpeed());
assertEquals(15, w.getGust());
assertEquals("KT", w.getUnit());
}
}
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<jacoco.coverage.instruction.minimum>0.98</jacoco.coverage.instruction.minimum>
<jacoco.coverage.branch.minimum>0.96</jacoco.coverage.branch.minimum>
<jacoco.coverage.complexity.minimum>0.97</jacoco.coverage.complexity.minimum>
<archunit-junit5.version>1.0.1</archunit-junit5.version>
<archunit-junit5.version>1.1.0</archunit-junit5.version>
<checkstyle.version>10.12.2</checkstyle.version>
<commons-lang3.version>3.13.0</commons-lang3.version>
<hamcrest.version>2.2</hamcrest.version>
Expand All @@ -67,7 +67,7 @@
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<commons-csv.version>1.10.0</commons-csv.version>
<pitest-junit5-plugin.version>1.2.0</pitest-junit5-plugin.version>
<pitest-maven.version>1.14.2</pitest-maven.version>
<pitest-maven.version>1.14.4</pitest-maven.version>
<slf4j-nop.version>2.0.7</slf4j-nop.version>
<spotbugs-maven-plugin.version>4.7.3.5</spotbugs-maven-plugin.version>
<sonar.organization>mivek-github</sonar.organization>
Expand Down

0 comments on commit f07affc

Please sign in to comment.