Skip to content

Commit

Permalink
Fix the calm wind regex
Browse files Browse the repository at this point in the history
This is a fix to mivek/python-metar-taf-parser#61. The calm wind was parsed as a visibility token.
  • Loading branch information
mivek committed Jan 15, 2024
1 parent 5fd5fe7 commit 0fa9643
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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,3})?(KT|MPS|KM/H)?");
private static final Pattern WIND_REGEX = Pattern.compile("^(VRB|000|[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 @@ -454,7 +454,7 @@ void testParseRunwayDeposit() {

@Test
void testParsWithLowWind() {
String code = "KATW 022045Z 0000KT 10SM SCT120 00/M08 A2996";
String code = "KATW 022045Z 00000KT 10SM SCT120 00/M08 A2996";

Metar m = parser.parse(code);
assertEquals("KATW", m.getStation());
Expand Down

0 comments on commit 0fa9643

Please sign in to comment.