package com.github.sormuras.bach.internal;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.lang.module.ModuleDescriptor.Version;
import org.junit.jupiter.api.Test;

class StringsTests {

  @Test
  void toNumberAndPreRelease() {
    assertEquals("1", Strings.toNumberAndPreRelease(Version.parse("1")));
    assertEquals("1-ea", Strings.toNumberAndPreRelease(Version.parse("1-ea")));
    assertEquals("1-ea", Strings.toNumberAndPreRelease(Version.parse("1-ea+2")));
    assertEquals("1+ea", Strings.toNumberAndPreRelease(Version.parse("1+ea+3")));
  }
}

@@ -149,16 +149,43 @@
 ersion;%0A
+import java.time.Duration;%0A
 import o
@@ -234,16 +234,579 @@
 ests %7B%0A%0A
+  @Test%0A  void durations() %7B%0A    assertEquals(%220s%22, Strings.toString(Duration.ZERO));%0A    assertEquals(%221ms%22, Strings.toString(Duration.ofMillis(1)));%0A    assertEquals(%22999ms%22, Strings.toString(Duration.ofMillis(999)));%0A    assertEquals(%221s 1ms%22, Strings.toString(Duration.ofMillis(1001)));%0A    assertEquals(%221s%22, Strings.toString(Duration.ofSeconds(1)));%0A    assertEquals(%2259s%22, Strings.toString(Duration.ofSeconds(59)));%0A    assertEquals(%221m%22, Strings.toString(Duration.ofSeconds(60)));%0A    assertEquals(%221m 1s%22, Strings.toString(Duration.ofSeconds(61)));%0A  %7D%0A%0A
   @Test%0A

Add duration to string assertions