package test.integration.project;

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

import com.github.sormuras.bach.project.DeclaredModule;
import com.github.sormuras.bach.project.Project;
import java.nio.file.Path;
import org.junit.jupiter.api.Test;

class ProjectTests {

  @Test
  void defaultProject() {
    var project = Project.ofDefaults();
    assertEquals("unnamed", project.name().toString());
  }

  @Test
  void parsingDirectoryWithCustomPattern() {
    var directory = Path.of("");
    var pattern = "glob:*/src/{init,main,test}/{java,java-module}/module-info.java";
    var project = Project.ofDefaults().withWalkingDirectory(directory, pattern);

    assertEquals("bach", project.name().toString());
    assertLinesMatch(
        """
        com.github.sormuras.bach
        com.github.sormuras.bach
        test.base
        test.integration
        """
            .lines(),
        project.modules().stream().map(DeclaredModule::name).sorted());
  }
}

@@ -480,16 +480,570 @@
 );%0A  %7D%0A%0A
+  @Test%0A  void parsingDirectoryWithDefaultPattern() %7B%0A    var directory = Path.of(%22%22);%0A    var project = Project.ofDefaults().withWalkingDirectory(directory);%0A%0A    assertEquals(%22bach%22, project.name().toString());%0A    assertLinesMatch(%0A        %22%22%22%0A        aggregator%0A        %3E%3E ... %3E%3E%0A        com.github.sormuras.bach%0A        com.github.sormuras.bach%0A        %3E%3E ... %3E%3E%0A        test.base%0A        test.integration%0A        %3E%3E ... %3E%3E%0A        world%0A        %22%22%22%0A            .lines(),%0A        project.modules().stream().map(DeclaredModule::name).sorted());%0A  %7D%0A%0A
   @Test%0A

Add test for default module find pattern