Skip to content

Commit

Permalink
Merge pull request #141 from fabricepipart/bugfix/more-than-an-hour
Browse files Browse the repository at this point in the history
Time longer than an hour
  • Loading branch information
fabricepipart authored Mar 8, 2023
2 parents 421e725 + b55eb65 commit 1ac97cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static Float parseSpeed(String line) {


public static String parseTime(String line) {
Pattern p = Pattern.compile("\\s[0-9]+'[0-9]{2}\\.[0-9]{3}");
Pattern p = Pattern.compile("\\s[0-9]*:?[0-9]+'[0-9]{2}\\.[0-9]{3}");
Matcher m = p.matcher(line);
while (m.find()) {
return m.group().trim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,13 @@ public void getTestPracticeAnalysisAsCsv() {

List<String> lines = content.lines().collect(Collectors.toList());

assertThat(lines.size()).isEqualTo(1386);
assertThat(lines.size()).isEqualTo(1392);
assertThat(lines.get(0)).containsAnyOf("NUMBER", "RIDER", "NATION", "TEAM", "MOTORCYCLE", "LAP_NUMBER", "TIME", "MAX_SPEED", "FRONT_TYRE", "BACK_TYRE", "FRONT_TYRE_LAP_NUMBER", "BACK_TYRE_LAP_NUMBER", "CANCELLED", "PIT", "UNFINISHED");
assertThat(lines).allMatch(s -> s.chars().filter(c -> c == ',').count() == 14);
assertThat(lines).noneMatch(s -> s.contains("null"));
assertThat(lines).anyMatch(s -> s.contains("Ducati Lenovo Team"));
assertThat(lines).anyMatch(s -> s.contains("ZA"));
assertThat(lines).anyMatch(s -> s.contains("1:"));
}

@Test
Expand Down

0 comments on commit 1ac97cf

Please sign in to comment.